本文整理汇总了C#中Data.GetAddress方法的典型用法代码示例。如果您正苦于以下问题:C# Data.GetAddress方法的具体用法?C# Data.GetAddress怎么用?C# Data.GetAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.GetAddress方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
//.........这里部分代码省略.........
ThreadsRead.Count.ToString() +
"</div> unread)</div> <span onclick='HideSocial()'>Stuff We Talk About</span>";
}
#region Take care of threads
SortDropDown.Items[1].Attributes.Add("onclick", "ShowLoading();");
SortDropDown.Items[2].Attributes.Add("onclick", "ShowLoading();");
SortDropDown.Items[3].Attributes.Add("onclick", "ShowLoading();");
SortThreads(SortDropDown, new EventArgs());
#endregion
//other details
//TagCloud.THE_ID = int.Parse(Request.QueryString["ID"].ToString());
GroupDescriptionLabel.Text = dvGroup[0]["Content"].ToString();
//Fix calendar timezone
RadScheduler1.TimeZoneOffset = -(DateTime.UtcNow.Subtract(dateNow));
HostLabel.Text = dvUser[0]["UserName"].ToString();
HostLabel.NavigateUrl = HostLabel.Text + "_Friend";
#region Take care of map
HttpCookie cookie2 = new HttpCookie("addressParameterName");
cookie2.Value = dvGroup[0]["Header"].ToString();
cookie2.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie2);
string address = "";
if (dvGroup[0]["Address"] != null)
{
if (dvGroup[0]["Address"].ToString() != "")
{
address = dat.GetAddress(dvGroup[0]["Address"].ToString(), dvGroup[0]["Country"].ToString() != "223");
}
}
cookie2 = new HttpCookie("addressParameter");
cookie2.Value = address + " " + dvGroup[0]["City"].ToString() + " " + dvGroup[0]["State"].ToString() +
" " + dvGroup[0]["Zip"].ToString() + " " + country;
cookie2.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie2);
Literal lit2 = new Literal();
lit2.Text = "<script src=\"http://maps.google.com/maps?file=api&v=2&sensor=false&key=ABQIAAAAjjoxQtYNtdn3Tc17U5-jbBR2Kk_H7gXZZZniNQ8L14X1BLzkNhQjgZq1k-Pxm8FxVhUy3rfc6L9O4g\" type=\"text/javascript\"></script>";
Page.Header.Controls.Add(lit2);
Master.BodyTag.Attributes.Add("onload", "initialize();");
Master.BodyTag.Attributes.Add("onunload", "GUnload()");
#endregion
#region Take care of main image
bool doVertical = false;
if (dvGroup[0]["MainPicture"] != null)
{
if (dvGroup[0]["MainPicture"].ToString().Trim() != "")
{
ImageLiteral.Text = "<div style=\"width: 200px;\"><div";
GroupMainImage.ImageUrl = "GroupFiles/" + dvGroup[0]["ID"].ToString() + "/Slider/" + dvGroup[0]["MainPicture"].ToString().Trim();
System.Drawing.Image img = System.Drawing.Image.FromFile(Server.MapPath("GroupFiles/" + dvGroup[0]["ID"].ToString() + "/Slider/" + dvGroup[0]["MainPicture"].ToString().Trim()));
if (img.Height < 200)
{
string toDivide = ((200 - img.Height) / 2).ToString();
ImageLiteral.Text += " style=\" padding-top: 10px; " + "\" ";
示例2: GetEventLiteral
//.........这里部分代码省略.........
TopLiteral.Text += oneStringRecord;
theArray[countInArray] = oneStringRecord;
dt.Rows.Clear();
countInArray++;
venueMapping.Clear();
venuesNumMapping.Clear();
}
venue = "";
isFirstElement = true;
i = 0;
}
address = "";
DataView dvV = new DataView();
if (row["VID"].ToString() != "NONE")
{
dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + row["VID"].ToString());
}
else
{
dvV = dat.GetDataDV("SELECT * FROM Events WHERE ID=" + row["EID"].ToString());
}
DataView dvCountry = dat.GetDataDV("SELECT * FROM countries WHERE country_id=" + dvV[0]["Country"].ToString());
country = dvCountry[0]["country_2_code"].ToString();
if (country.ToLower() == "us")
{
try
{
if (row["VID"].ToString() != "NONE")
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), false);
}
else
{
address = dvV[0]["Address"].ToString();
}
}
catch (Exception ex1)
{
address = "";
}
}
else
{
if (row["VID"].ToString() != "NONE")
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), true);
}
else
{
address = dvV[0]["Address"].ToString();
}
}
if (!normalEventHash.Contains(row["EID"].ToString()))
{
normalEventHash.Add(row["EID"].ToString(), normalRecordCount.ToString());
if (dvV[0]["Country"].ToString().ToLower() == "222")
{
//VenueName.Text + "@&" +
示例3: InsertRevision
protected void InsertRevision(ref Telerik.Web.UI.RadPanelItem item2, DataSet dsChanges, int n,
string tempstr, ref int count, DataSet ds, int i)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
if (dsChanges.Tables[0].Rows[0][n + 3].ToString().Trim() != "")
{
Label theLab = new Label();
if (count != 1)
theLab.Text = tempstr;
string content = "";
string str = "venue";
if (ds.Tables[0].Rows[i]["Mode"].ToString() == "4")
str = "event";
bool isVenue = false;
if (str == "venue")
isVenue = true;
string colName = dsChanges.Tables[0].Columns[n + 3].ColumnName.ToLower();
if (!isVenue && (colName == "zip" || colName == "state" || colName == "city" || colName == "country"))
{
}
else
{
if (dsChanges.Tables[0].Columns[n + 3].ColumnName.ToLower() == "address")
{
DataView dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" +
dsChanges.Tables[0].Rows[0]["VenueID"].ToString());
if (dvV[0]["Country"].ToString() == "223")
content = dat.GetAddress(dsChanges.Tables[0].Rows[0][n + 3].ToString(), false);
else
content = dat.GetAddress(dsChanges.Tables[0].Rows[0][n + 3].ToString(), true);
}
else if (dsChanges.Tables[0].Columns[n + 3].ColumnName.ToLower() == "venue")
{
DataView dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dsChanges.Tables[0].Rows[0][n + 3].ToString());
content = "<a class=\"AddLink\" target=\"_blank\" href=\"" +
dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
dsChanges.Tables[0].Rows[0][n + 3].ToString() +
"_Venue\">" + dvV[0]["Name"].ToString() + "</a>";
}
else
{
content = dsChanges.Tables[0].Rows[0][n + 3].ToString();
}
theLab.Text += count + ". " + dsChanges.Tables[0].Columns[n + 3].ColumnName + " Change Request To: <br/><br/>" +
dat.BreakUpString(content, 30) + "<br/>";
count++;
item2.Controls.Add(theLab);
bool notSeen = dat.isNotSeen(dsChanges, n);
bool isApproved = dat.isApproved(dsChanges, n);
bool changeHasBeenMade = true;
if (notSeen && changeHasBeenMade)
{
HtmlButton img = new HtmlButton();
img.Attributes.Add("commArg", str);
img.Attributes.Add("commandargument", dsChanges.Tables[0].Rows[0]["ID"].ToString() +
"accept" + (n + 3).ToString());
img.ID = dsChanges.Tables[0].Rows[0]["ID"].ToString() + "accept" + (n + 3).ToString();
img.Style.Value = "cursor: pointer;float: right;font-size: 11px;font-weight: bold;margin-top: 20px; padding-bottom: 4px;height: 30px; width: 112px;background-color: transparent; " +
"color: White; background-image: url('image/PostButtonNoPost.png'); background-repeat: " +
"no-repeat; border: 0;";
img.ServerClick += new EventHandler(ServerAcceptChange);
img.Attributes.Add("onmouseover", "this.style.backgroundImage = 'url(image/PostButtonNoPostHover.png)';");
img.Attributes.Add("onmouseout", "this.style.backgroundImage = 'url(image/PostButtonNoPost.png)';");
img.Attributes.Add("onclick", "this.innerHTML = 'Working...';this.disabled=true;this.style.backgroundImage = 'url(image/PostButtonNoPostHover.png)';");
img.InnerText = "Accept";
item2.Controls.Add(img);
img = new HtmlButton();
img.Attributes.Add("commArg", str);
img.Attributes.Add("commandargument", dsChanges.Tables[0].Rows[0]["ID"].ToString() + "reject" +
(n + 3).ToString());
img.ID = dsChanges.Tables[0].Rows[0]["ID"].ToString() + "reject" + (n + 3).ToString();
img.Style.Value = "cursor: pointer;float: right;font-size: 11px;font-weight: bold;margin-top: 20px; padding-bottom: 4px;height: 30px; width: 112px;background-color: transparent; " +
"color: White; background-image: url('image/PostButtonNoPost.png'); background-repeat: " +
"no-repeat; border: 0;";
img.ServerClick += new EventHandler(ServerRejectChange);
img.Attributes.Add("onmouseover", "this.style.backgroundImage = 'url(image/PostButtonNoPostHover.png)';");
img.Attributes.Add("onmouseout", "this.style.backgroundImage = 'url(image/PostButtonNoPost.png)';");
img.Attributes.Add("onclick", "this.innerHTML = 'Working...';this.disabled=true;this.style.backgroundImage = 'url(image/PostButtonNoPostHover.png)';");
img.InnerText = "Reject";
item2.Controls.Add(img);
}
else
{
//.........这里部分代码省略.........
示例4: Page_Load
//.........这里部分代码省略.........
VenueName.Text = "<a id=\"" + dat.MakeNiceNameFull(ds.Tables[0].Rows[0]["Name"].ToString()) + "\" class=\"aboutLink\" href=\"" +
theLink + "\"><h1>" + dat.BreakUpString(ds.Tables[0].Rows[0]["Name"].ToString(), 50) + "</h1></a>";
Session["Subject"] = "Re: " + ds.Tables[0].Rows[0]["Name"].ToString();
Session["CommentSubject"] = "Re: " + ds.Tables[0].Rows[0]["Name"].ToString();
string Venue = dat.BreakUpString(ds.Tables[0].Rows[0]["Name"].ToString(), 14);
string url = ds.Tables[0].Rows[0]["Web"].ToString();
if (url.Length > 8)
{
if (url.ToLower().Substring(0, 7) != "http://" && url.ToLower().Substring(0, 8) != "https://")
url = "http://" + url;
}
PhoneLabel.Text = "Phone: " + dat.BreakUpString(ds.Tables[0].Rows[0]["Phone"].ToString(), 15) + "<br/>Email: " +
dat.BreakUpString(ds.Tables[0].Rows[0]["Email"].ToString(), 15) + "<br/>Web: <a class='AddLink' target='_blank' href='" + url + "'>" +
dat.BreakUpString(ds.Tables[0].Rows[0]["Web"].ToString(), 17) + "</a>";
DataSet dsCountry = new DataSet();
string country = "";
if (ds.Tables[0].Rows[0]["Country"] != null)
{
dsCountry = dat.GetData("SELECT country_2_code FROM Countries WHERE country_id=" + ds.Tables[0].Rows[0]["Country"].ToString());
if (dsCountry.Tables[0].Rows.Count > 0)
{
country = dsCountry.Tables[0].Rows[0]["country_2_code"].ToString();
}
}
if (country.ToLower() == "us")
{
try
{
AddressLabel.Text = dat.GetAddress(ds.Tables[0].Rows[0]["Address"].ToString(), false);
}
catch (Exception ex1)
{
AddressLabel.Text = "";
}
}
else
{
AddressLabel.Text = dat.GetAddress(ds.Tables[0].Rows[0]["Address"].ToString(), true);
}
//if (ds.Tables[0].Rows[0]["Country"].ToString() == "222")
//{
// CityState.Text = ds.Tables[0].Rows[0]["City"].ToString();
//}
//else
//{
CityState.Text = ds.Tables[0].Rows[0]["City"].ToString() + " " +
ds.Tables[0].Rows[0]["State"].ToString() + " " + ds.Tables[0].Rows[0]["Zip"].ToString();
//}
HttpCookie cookie2 = new HttpCookie("addressParameter");
HttpCookie cookiename = new HttpCookie("addressParameterName");
if (country.ToLower() == "uk")
{
//VenueName.Text + "@&" +
cookie2.Value = AddressLabel.Text + "@&" +
ds.Tables[0].Rows[0]["City"].ToString() + ", " +
ds.Tables[0].Rows[0]["Zip"].ToString() + ", " + country;
示例5: GetAllEventLiteral
protected int GetAllEventLiteral(DataView dv, Data dat)
{
Hashtable normalEventHash = new Hashtable();
DataView dvEvents = dv;
int i = 0;
string theLiteral = "<script type=\"text/javascript\">function initializeAll(){var address;";
int thecount = dvEvents.Count;
string oneStringRecord = "";
int normalRecordCount = 0;
int countOfAllUniqueVenues = 0;
try
{
string address = "";
string venue = "";
bool isFirstElement = true;
string country = "US";
Hashtable venueMapping = new Hashtable();
Hashtable venuesNumMapping = new Hashtable();
DataView dvRecords = new DataView();
DataTable dt = new DataTable();
DataColumn dc2 = new DataColumn("Address");
dt.Columns.Add(dc2);
dc2 = new DataColumn("Letter");
dt.Columns.Add(dc2);
foreach (DataRowView row in dvEvents)
{
if (!bool.Parse(row["isGroup"].ToString()))
{
if (!normalEventHash.Contains(row["EID"].ToString()))
{
normalEventHash.Add(row["EID"].ToString(), normalRecordCount.ToString());
address = "";
DataView dvE = dat.GetDataDV("SELECT * FROM Events WHERE ID=" + row["EID"].ToString());
DataView dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvE[0]["Venue"].ToString());
DataView dvCountry = dat.GetDataDV("SELECT * FROM countries WHERE country_id=" + dvE[0]["Country"].ToString());
country = dvCountry[0]["country_2_code"].ToString();
if (country.ToLower() == "us")
{
try
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), false);
}
catch (Exception ex1)
{
address = "";
}
}
else
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), true);
}
if (dvE[0]["Country"].ToString().ToLower() == "uk")
{
//VenueName.Text + "@&" +
if (venueMapping.ContainsKey(address))
{
venueMapping[address] += ",<br/><div style=\\\"color: #1fb6e7; font-weight: bold; text-decoration: underline; float: left; cursor: pointer;\\\" onclick=\\\"CloseWindow(\\'" + "../" +
dat.MakeNiceName(dvE[0]["Header"].ToString()) + "_" +
dvE[0]["ID"].ToString() + "_Event" + "\\');\\\">" +
dat.CleanExcelString(dvE[0]["Header"].ToString().Replace("'",
" ").Replace("(", " ").Replace(")", " ")) + "</div>";
}
else
{
countOfAllUniqueVenues++;
if (!isFirstElement)
{
i++;
venuesNumMapping.Add(address, dat.GetImage(i.ToString()));
venueMapping.Add(address, "address = '" + address.Trim().Replace("'", "''").Replace("(", " ").Replace(")", " ") + " " +
dvV[0]["City"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + ", " +
dvV[0]["Zip"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + ", " +
country.Replace("'", " ").Replace("(", " ").Replace(")", " ") + "'; " +
"showAddressUS('<span style=\\\"color: #98cb2a; font-weight: bold;text-decoration: underline; " +
" cursor: pointer;\\\" onclick=\\\"CloseWindow(\\'" + "../" +
dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
dvV[0]["ID"].ToString() + "_Venue" + "\\');\\\">" +
dvV[0]["Name"].ToString().Replace("'",
" ").Replace("(", " ").Replace(")", " ") + "</span>', 1, address, 0, address, 1, " + i.ToString() + ", '" +
"<div style=\\\"color: #1fb6e7; font-weight: bold; text-decoration: underline; float: left; cursor: pointer;\\\" onclick=\\\"CloseWindow(\\'" + "../" +
dat.MakeNiceName(dvE[0]["Header"].ToString()) + "_" +
dvE[0]["ID"].ToString() + "_Event" + "\\');\\\">" +
dat.CleanExcelString(dvE[0]["Header"].ToString().Replace("'",
" ").Replace("(", " ").Replace(")", " ")) + "</div>");
DataRow r = dt.NewRow();
r["Address"] = address;
r["Letter"] = dat.GetImage(i.ToString());
dt.Rows.Add(r);
}
//.........这里部分代码省略.........
示例6: Page_Load
//.........这里部分代码省略.........
if (dvGroup[0]["Agenda"].ToString().Trim() != "")
{
AgendaLiteral.Text = MakeAgenda(dvGroup[0]["Agenda"].ToString()).Replace("color: #cccccc;", "color: #" + dvGroup[0]["TextB"].ToString() + ";");
AgendaPanel.Visible = true;
}
else
AgendaPanel.Visible = false;
}
else
{
AgendaPanel.Visible = false;
}
//TagCloud.THE_ID = int.Parse(Request.QueryString["ID"].ToString());
GroupDescriptionLabel.Text = dvGroup[0]["Content"].ToString();
HostLabel.Text = dvUser[0]["UserName"].ToString();
#region Take care of map
HttpCookie cookie2 = new HttpCookie("addressParameterName");
cookie2.Value = dvGroup[0]["Name"].ToString();
cookie2.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie2);
bool isVenue = false;
string address = "";
if (dvEvent[0]["VenueID"] != null)
{
if (dvEvent[0]["VenueID"].ToString().Trim() != "")
{
DataView dvVenue = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvEvent[0]["VenueID"].ToString());
NameOfPlaceLabel.Text = dvVenue[0]["Name"].ToString() + "<br />";
address = dat.GetAddress(dvVenue[0]["Address"].ToString(), dvVenue[0]["Country"].ToString() != "223");
isVenue = true;
Address1Label.Text = address;
Address2Label.Visible = false;
CityStateZipLabel.Text = dvVenue[0]["City"].ToString() + ", " +
dvVenue[0]["State"].ToString() + " " + dvVenue[0]["Zip"].ToString();
}
else
NameOfPlaceLabel.Visible = false;
}
else
NameOfPlaceLabel.Visible = false;
if (!isVenue)
{
if (dvEvent[0]["Country"].ToString() == "223")
{
address = dvEvent[0]["StreetNumber"].ToString() + " " + dvEvent[0]["StreetName"].ToString() +
" " + dvEvent[0]["StreetDrop"].ToString();
}
else
{
address = dvEvent[0]["Location"].ToString();
}
}
cookie2 = new HttpCookie("addressParameter");
cookie2.Value = address + " " + dvEvent[0]["City"].ToString() + " " + dvEvent[0]["State"].ToString() +
" " + dvEvent[0]["Zip"].ToString() + " " + country;
示例7: GetEventLiteral
//.........这里部分代码省略.........
rowCount++;
}
TopLiteral.Text += oneStringRecord;
theArray[countInArray] = oneStringRecord;
dt.Rows.Clear();
countInArray++;
venueMapping.Clear();
venuesNumMapping.Clear();
}
venue = "";
isFirstElement = true;
i = 0;
}
if (!bool.Parse(row["isGroup"].ToString()))
{
if (!normalEventHash.Contains(row["EID"].ToString()))
{
normalEventHash.Add(row["EID"].ToString(), normalRecordCount.ToString());
row["CalendarNum"] = dat.GetCalendarLetter(normalRecordCount);
address = "";
DataView dvE = dat.GetDataDV("SELECT * FROM Events WHERE ID=" + row["EID"].ToString());
DataView dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvE[0]["Venue"].ToString());
DataView dvCountry = dat.GetDataDV("SELECT * FROM countries WHERE country_id=" + dvE[0]["Country"].ToString());
country = dvCountry[0]["country_2_code"].ToString();
if (country.ToLower() == "us")
{
try
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), false);
}
catch (Exception ex1)
{
address = "";
}
}
else
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), true);
}
if (dvE[0]["Country"].ToString().ToLower() == "uk")
{
//VenueName.Text + "@&" +
if (venueMapping.ContainsKey(address))
{
row["SearchNum"] = venuesNumMapping[address].ToString();
venueMapping[address] += ",<br/><div style=\\\"color: #1fb6e7; font-weight: bold; text-decoration: underline; float: left; cursor: pointer;\\\" onclick=\\\"CloseWindow(\\'" + "../" +
dat.MakeNiceName(dvE[0]["Header"].ToString()) + "_" +
dvE[0]["ID"].ToString() + "_Event" + "\\');\\\">" +
dat.CleanExcelString(dvE[0]["Header"].ToString().Replace("'",
" ").Replace("(", " ").Replace(")", " ")) + "</div>";
}
else
{
if (!isFirstElement)
{
i++;
venuesNumMapping.Add(address, dat.GetImage(i.ToString()));
venueMapping.Add(address, "address = '" + address.Trim().Replace("'", "''").Replace("(", " ").Replace(")", " ") + " " +
dvV[0]["City"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + ", " +
dvV[0]["Zip"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + ", " +
示例8: GetAllVenuesLiteral
protected void GetAllVenuesLiteral(DataView dvEvents, Data dat)
{
string theLiteral = "<script type=\"text/javascript\">function initializeAll(){" +
" if(map != null && map != undefined) " +
" { " +
" var address;";
string address = "";
string country = "US";
foreach (DataRowView row in dvEvents)
{
address = "";
DataView dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + row["VID"].ToString());
DataView dvCountry = dat.GetDataDV("SELECT * FROM countries WHERE country_id=" +
dvV[0]["Country"].ToString());
country = dvCountry[0]["country_2_code"].ToString();
if (country.ToLower() == "us")
{
try
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), false);
}
catch (Exception ex1)
{
address = "";
}
}
else
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), true);
}
if (dvV[0]["Country"].ToString().ToLower() == "uk")
{
theLiteral += "address = '" + address.Replace("'", "''").Replace("(", " ").Replace(")", " ") +
dvV[0]["City"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + ", " +
dvV[0]["Zip"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + ", " +
country.Replace("'", " ").Replace("(", " ").Replace(")", " ") + "'; " +
"showAddressUS('',1, address, 0, address, 1, 0, '" +
"<div style=\\\"color: #98cb2a;font-weight: bold;text-decoration: underline; float: left; cursor: pointer;\\\" " +
"onclick=\\\"CloseWindow(\\'" + "../" +
dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
dvV[0]["ID"].ToString() + "_Venue" + "\\');\\\">" +
dvV[0]["Name"].ToString().Replace("'", " ").Replace("(",
" ").Replace(")", " ") + "</div>', false);";
}
else
{
theLiteral += "address = '" + address +
dvV[0]["City"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
dvV[0]["State"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
dvV[0]["Zip"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
country.Replace("'", " ").Replace("(", " ").Replace(")", " ") + "'; " +
"showAddressUS('',1, address, 0, address, 1, 0, '" +
"<div style=\\\"color: #98cb2a;font-weight: bold;text-decoration: underline; float: left; cursor: pointer;\\\" onclick=\\\"CloseWindow(\\'" + "../" +
dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
dvV[0]["ID"].ToString() + "_Venue" + "\\');\\\">" +
dvV[0]["Name"].ToString().Replace("'", " ").Replace("(",
" ").Replace(")", " ") + "</div>', false);";
}
}
ScriptLiteral.Text += theLiteral + "}}</script>";
}
示例9: RadScheduler1_AppointmentCreated
protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
{
try
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
char[] delim = { ';' };
string[] calendarKeys = e.Appointment.ID.ToString().Split(delim);
bool isGroup = bool.Parse(calendarKeys[0]);
string EID = calendarKeys[1];
string reoccurrID = calendarKeys[2];
bool isVenue = false;
DataView dvE = new DataView();
DataView dvV = new DataView();
DataView dvCountry = new DataView();
string theDate = "";
string eventLink = "";
string venueStr = "";
string address = "";
string country = "";
string eventColumnTitle = "";
if (isGroup)
{
eventColumnTitle = "Name";
country = dat.GetDataDV("SELECT * FROM Countries C, GroupEvent_Occurance GEO WHERE GEO.ID=" +
reoccurrID + " AND C.country_id=GEO.Country ")[0]["country_2_code"].ToString();
dvE = dat.GetDataDV("SELECT * FROM GroupEvents E, GroupEvent_Occurance EO WHERE EO.ID=" + reoccurrID +
" and EO.GroupEventID=E.ID AND E.ID=" + EID);
if (dvE[0]["VenueID"] != null)
{
if (dvE[0]["VenueID"].ToString() != "")
{
isVenue = true;
dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvE[0]["VenueID"].ToString());
venueStr = "<span style=\"color: #98cb2a; " +
"font-weight: bold;text-decoration: underline; " +
" cursor: pointer;\" onclick=\"CloseWindow(\'" + "../" +
dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
dvV[0]["ID"].ToString() + "_Venue" + "\');\">" +
dvV[0]["Name"].ToString().Replace("'",
" ").Replace("(", " ").Replace(")", " ") + "</span><br/>";
}
}
eventLink = dat.MakeNiceName(dvE[0]["Name"].ToString()) + "_" + reoccurrID + "_" +
dvE[0]["ID"].ToString() + "_GroupEvent";
if (!isVenue)
{
if (dvE[0]["Country"].ToString() == "223")
{
address = dvE[0]["StreetNumber"].ToString() + " " + dvE[0]["StreetName"].ToString() +
" " + dvE[0]["StreetDrop"].ToString();
}
else
{
address = dvE[0]["Location"].ToString();
}
}
else
{
address = dat.GetAddress(dvV[0]["Address"].ToString(),
dvV[0]["Country"].ToString() != "223").Trim();
}
address = address.Trim() + " " + dvE[0]["City"].ToString() + " " + dvE[0]["State"].ToString() +
" " + dvE[0]["Zip"].ToString() + " " + country;
}
else
{
eventColumnTitle = "Header";
dvE = dat.GetDataDV("SELECT * FROM Events E, Event_Occurance EO WHERE EO.ID=" + reoccurrID +
" and EO.EventID=E.ID AND E.ID=" + EID);
dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvE[0]["Venue"].ToString());
dvCountry = dat.GetDataDV("SELECT * FROM countries WHERE country_id=" + dvE[0]["Country"].ToString());
country = dvCountry[0]["country_2_code"].ToString();
if (country.ToLower() == "us")
{
try
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), false);
}
catch (Exception ex1)
{
address = "";
}
}
else
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), true);
}
address = address.Trim().Replace("'", "''").Replace("(", " ").Replace(")", " ") + " " +
//.........这里部分代码省略.........
示例10: GetVenuesLiteral
//.........这里部分代码省略.........
else
{
oneStringRecord += venueMapping[rowster["Address"].ToString()].ToString() +
"', false);".Replace(" ",
" ").Replace(" ", " ");
}
rowCount++;
}
TopLiteral.Text += oneStringRecord;
theArray[countInArray] = oneStringRecord;
dt.Rows.Clear();
countInArray++;
venueMapping.Clear();
venuesNumMapping.Clear();
}
lastAddress = "";
isFirstElement = true;
i = 0;
}
isAddressSame = false;
address = "";
DataView dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + row["VID"].ToString());
DataView dvCountry = dat.GetDataDV("SELECT * FROM countries WHERE country_id=" +
dvV[0]["Country"].ToString());
country = dvCountry[0]["country_2_code"].ToString();
if (country.ToLower() == "us")
{
try
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), false);
}
catch (Exception ex1)
{
address = "";
}
}
else
{
address = dat.GetAddress(dvV[0]["Address"].ToString(), true);
}
if (lastAddress == address && !isFirstElement)
isAddressSame = true;
else
isAddressSame = false;
if (dvV[0]["Country"].ToString().ToLower() == "uk")
{
if (venueMapping.ContainsKey(address))
{
row["SearchNum"] = venuesNumMapping[address].ToString();
venueMapping[address] += ",<br/><div style=\\\"color: #98cb2a;font-weight: bold;text-decoration: underline; float: left; cursor: pointer;\\\" " +
"onclick=\\\"CloseWindow(\\'" + "../" +
dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
dvV[0]["ID"].ToString() + "_Venue" + "\\');\\\">" +
dvV[0]["Name"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + "</div>";
}
else
{
if (!isFirstElement)
{
i++;
示例11: Page_Load
//.........这里部分代码省略.........
item.Selected = true;
}
}
foreach (ListItem item in MeansCheckList3.Items)
{
if (dv[0]["Means"].ToString().Contains(item.Value))
{
item.Selected = true;
}
}
DataView dvBring = dat.GetDataDV("SELECT * FROM Trips_WhatToBring WHERE TripID=" + eventID);
int count = 1;
foreach (DataRowView row in dvBring)
{
BringLabel.Text += count.ToString() + ". " + row["WhatToBring"].ToString() + "<br/>";
count++;
}
dvBring = dat.GetDataDV("SELECT * FROM TripDirections WHERE TripID=" + eventID);
count = 1;
string dirFunc = "function PlotMapDirections(){var address; var address2; \r\n";
string prevAddrs = "";
string thisAddress = "";
int mapCount = 0;
string walking = "";
if (dvBring.Count == 1)
{
Directions.Text += count.ToString() + ". " + dvBring[0]["Directions"].ToString();
MapLiteral.Text = "<div id=\"map_canvas\" class=\"TripMapCanvas\"></div>";
thisAddress = dat.GetAddress(dvBring[0]["Address"].ToString(),
dvBring[0]["Country"].ToString() != "223") + " " + dvBring[0]["City"].ToString() + " " + dvBring[0]["State"].ToString() +
" " + dvBring[0]["Zip"].ToString() + " " + dvBring[0]["Country"].ToString();
dirFunc += "map = new GMap2(document.getElementById(\"map_canvas\")); map.setUIToDefault(); " +
"address = '" +
thisAddress.Replace("'", "''") + "'; createMarker(address, '" + dv[0]["Header"].ToString().Replace("'", "''") +
"','<div class=\"MapHeader\"><h2>" + dv[0]["Header"].ToString().Replace("'", "''") + ":</h2> <br/>" + dvBring[0]["Directions"].ToString().Replace("'", "''") + "</div>');}";
}
else
{
string firstAddress = "";
foreach (DataRowView row in dvBring)
{
Directions.Text += count.ToString() + ". " + row["Directions"].ToString() + "<br/>";
count++;
thisAddress = dat.GetAddress(row["Address"].ToString(),
row["Country"].ToString() != "223") + " " + row["City"].ToString() + " " + row["State"].ToString() +
" " + row["Zip"].ToString() + " " + row["Country"].ToString();
if (prevAddrs != "")
{
if ((bool)row["Walking"])
walking = "{travelMode:G_TRAVEL_MODE_WALKING}";
else
walking = "{travelMode:G_TRAVEL_MODE_DRIVING}";
dirFunc += "map = new GMap2(document.getElementById(\"map_canvas" +
mapCount.ToString() + "\")); \r\n map.setUIToDefault();\r\n directionsPanel = document.getElementById(\"my_textual_div" +
mapCount.ToString() + "\"); \r\n directions = " +
"new GDirections(map, directionsPanel);directions.load(\"from: " + prevAddrs.Replace("'", "''") +
" to: " + thisAddress.Replace("'", "''") + "\", " + walking + ");\r\n ";
GoogleDirectionsLiteral.Text += "<div id=\"my_textual_div" + mapCount.ToString() + "\"></div>";
MapLiteral.Text += "<div class=\"MapLiteral2\" id=\"map_canvas" + mapCount.ToString() + "\"></div>";
mapCount++;