本文整理汇总了C#中Customers.getCustomersAndAddressesByRoute方法的典型用法代码示例。如果您正苦于以下问题:C# Customers.getCustomersAndAddressesByRoute方法的具体用法?C# Customers.getCustomersAndAddressesByRoute怎么用?C# Customers.getCustomersAndAddressesByRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers.getCustomersAndAddressesByRoute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
/// <summary>
/// Loads the page and analizes the QueryString to catch de GET vars.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (Request.QueryString.Get("id") != null)
{
int idRoute = Convert.ToInt16(Request.QueryString.Get("id"));
Routes route = new Routes();
DataTable dt;
dt = route.getRouteByID(idRoute);
if (dt != null && dt.Columns[0].Caption == "Router_Dont_Exists")
{
Response.Redirect(webURL + "views/routes/viewallroutes.aspx");
}
else if (dt.Rows.Count == 1)
{
this.routeid = dt.Rows[0].ItemArray[0].ToString();
this.name = dt.Rows[0].ItemArray[1].ToString();
DetailsView1.DataSource = dt;
DetailsView1.DataBind();
if (DetailsView1.Rows[2].Cells[1].Text == " ")
{
DetailsView1.Rows[2].Cells[1].Text = "<a href=\"" + webURL + "views/routes/assignroutes.aspx\">Asignar</a>";
}
Customers customers = new Customers();
dt = customers.getCustomersAndAddressesByRoute(Convert.ToInt16(this.routeid));
if (dt != null && dt.Rows.Count > 0 )
{
showCustomers = true;
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
showCustomers = false;
}
}
else
{
Response.Redirect(webURL + "views/routes/viewallroutes.aspx");
}
}
else
{
Response.Redirect(webURL + "views/routes/viewallroutes.aspx");
}
}
catch (Exception ex)
{
Response.Redirect(webURL + "views/routes/viewallroutes.aspx");
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
try
{
Routes route = new Routes();
DataTable dt;
dt = route.getAllRoutes();
if (dt != null && dt.Rows.Count == 1)
{
showData = true;
this.routeid = dt.Rows[0].ItemArray[0].ToString();
this.name = dt.Rows[0].ItemArray[1].ToString();
DetailsView1.DataSource = dt;
DetailsView1.DataBind();
Customers customers = new Customers();
dt = customers.getCustomersAndAddressesByRoute(Convert.ToInt16(this.routeid));
if (dt != null && dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
this.setNotification("nothing");
}
}
else
{
showData = false;
this.setNotification("error", "No hay ruta asignada", "Todavía no te es asignada una ruta...");
}
}
catch (Exception ex)
{
this.setNotification("error", "No hay ruta asignada", "Todavía no te es asignada una ruta");
}
}
示例3: loadCustomers
/// <summary>
/// Loads all the Customers and its Addresses on the gridview
/// </summary>
protected void loadCustomers(int idRoute)
{
Customers customers = new Customers();
DataTable dt;
dt = customers.getCustomersAndAddressesToEdit(idRoute);
if (dt != null && dt.Rows.Count > 0)
{
showCustomers = true;
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
showCustomers = false;
}
DataTable addressesByRoute;
addressesByRoute = customers.getCustomersAndAddressesByRoute(idRoute);
for (int i = 0; i < addressesByRoute.Rows.Count; i++)
{
this.idAddressesByRoute.Add(addressesByRoute.Rows[i].ItemArray[0].ToString());
}
this.setDataToScript(this.idAddressesByRoute);
}