本文整理汇总了C#中Customers.getCustomerAddresses方法的典型用法代码示例。如果您正苦于以下问题:C# Customers.getCustomerAddresses方法的具体用法?C# Customers.getCustomerAddresses怎么用?C# Customers.getCustomerAddresses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers.getCustomerAddresses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 idCustomer = Convert.ToInt16(Request.QueryString.Get("id"));
Customers customer = new Customers();
DataTable dt;
dt = customer.getCustomerByID(idCustomer);
if (dt != null && dt.Columns[0].Caption == "Customer_Dont_Exists")
{
Response.Redirect(webURL + "views/customers/viewallcustomers.aspx");
}
else if (dt.Rows.Count == 1)
{
this.customerid = dt.Rows[0].ItemArray[0].ToString();
this.name = dt.Rows[0].ItemArray[1].ToString() + " " + dt.Rows[0].ItemArray[2].ToString();
DetailsView1.DataSource = dt;
DetailsView1.DataBind();
dt = customer.getCustomerAddresses(idCustomer);
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
Response.Redirect(webURL + "views/customers/viewallcustomers.aspx");
}
}
else
{
Response.Redirect(webURL + "views/customers/viewallcustomers.aspx");
}
}
catch (Exception ex)
{
Response.Redirect(webURL + "views/customers/viewallcustomers.aspx");
}
}
示例2: loadAddresses
/// <summary>
/// Method to loads the Addresses of the selected Customer
/// </summary>
/// <param name="idCustomer">Int ID of the Customer</param>
protected void loadAddresses(int idCustomer)
{
Customers customer = new Customers();
DataTable dt = customer.getCustomerAddresses(idCustomer);
if (dt != null && dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
this.Addresses.Add(dt.Rows[i].ItemArray[0].ToString());
this.Phones.Add(dt.Rows[i].ItemArray[1].ToString());
}
}
}