本文整理汇总了C#中Customer.GetCustomerByID方法的典型用法代码示例。如果您正苦于以下问题:C# Customer.GetCustomerByID方法的具体用法?C# Customer.GetCustomerByID怎么用?C# Customer.GetCustomerByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer.GetCustomerByID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetData
private void SetData()
{
try
{
if (ObjInv!=null)
{
lblDate.Text = DateTime.Now.ToString("dd-MMM-yyyy");
//ObjInv.CreatedDate.ToString("dd-MMM-yyyy");
Customer cust = new Customer();
cust.CustomerID = ObjInv.CustomerID.HasValue ? ObjInv.CustomerID.Value : 1;
cust.GetCustomerByID();
lblCustomerName.Text = cust.Cus_Name;
User user = new User();
user.UserId = ObjInv.CreatedUser;
user.GetUserByID();
lblSalesPerson.Text = user.FirstName;
if (ObjInv.DsInvoiceDetails != null)
{
gvItemList.DataSource = ObjInv.DsInvoiceDetails;
gvItemList.DataBind();
}
lblInvAmount.Text = Decimal.Round(ObjInv.GrandTotal, 2).ToString();
}
}
catch (Exception ex)
{
throw ex;
}
}
示例2: FillParameters
/// <summary>
/// This method is used to fill the parameter values
/// </summary>
/// <param name="invoiceId"></param>
public void FillParameters(Int32 invoiceId)
{
try
{
this.InvoiceId.Value = invoiceId;
DsPrintInvoiceTableAdapters.vw_Invoice_Detail_Sel_ReportTableAdapter tableAdopter = new DsPrintInvoiceTableAdapters.vw_Invoice_Detail_Sel_ReportTableAdapter();
tableAdopter.Fill(this.dsPrintInvoice1.vw_Invoice_Detail_Sel_Report, invoiceId);
Invoice invoice = new Invoice();
invoice.InvoiceId = invoiceId;
invoice.GetInvoiceByInvoiceID();
this.InvoiceNumber.Value = invoice.InvoiceNo;
this.InvDate.Value = invoice.Date.ToShortDateString();
switch (invoice.PaymentType)
{
case "1":
this.PaymentType.Value = "Cash";
break;
case "2":
this.PaymentType.Value = "Cheque";
break;
case "3":
this.PaymentType.Value = "Credit Card";
break;
default:
this.PaymentType.Value = "N/A";
break;
}
if (invoice.Status != LankaTiles.Common.Structures.InvoiceStatus.Created)
{
lblDuplicate.Visible = true;
}
Customer customer = new Customer();
customer.CustomerID = (Int32)invoice.CustomerID;
customer.GetCustomerByID();
this.CustomerCode.Value = customer.CustomerCode.Trim();
this.CustomerName.Value = customer.Cus_Name.Trim();
this.GrandTotal.Value = Decimal.Round(invoice.GrandTotal, 2);
this.TotalPaid.Value = Decimal.Round(invoice.GrandTotal - invoice.DueAmount, 2);
this.DueAmmount.Value = Decimal.Round(invoice.DueAmount, 2);
User user = new User();
user.UserId = invoice.CreatedUser;
user.GetUserByID();
this.SPName.Value = user.FirstName.Trim();
}
catch (Exception ex)
{
throw ex;
}
}
示例3: CustomerSelectChange
/// <summary>
/// Populate customer details by customer
/// </summary>
private void CustomerSelectChange()
{
try
{
if (ddlCustomerCode.SelectedValue != "-1")
{
Customer cust = new Customer();
cust.CustomerID = int.Parse(ddlCustomerCode.SelectedValue);
cust.GetCustomerByID();
txtCus_Adress.Text = cust.Cus_Address;
txtGRNIds.Text = cust.GRNIds;
if (hdnInvId.Value == "0")
{
//txtCustomerCredBal.Text = Decimal.Round(cust.Cus_CreditTotal, 2).ToString();
}
}
else
{
txtCus_Adress.Text = "";
txtCustomerCredBal.Text = "0";
}
}
catch (Exception ex)
{
throw ex;
}
}
示例4: CreditOptionSelectChange
/// <summary>
/// Credit option select change method
/// </summary>
private void CreditOptionSelectChange()
{
try
{
hdnGRNId.Value = "0";
txtGRNId.Text = "";
btnCheckGRNId.Enabled = false;
txtCustomerCredBal.Text = "0";
rvCustomerBal.MinimumValue = "0";
rvCustomerBal.Enabled = true;
switch (ddlCreditOption.SelectedValue.ToString())
{
case "-1"://Select Option
break;
case "1"://Customer
Customer cust = new Customer();
cust.CustomerID = int.Parse(ddlCustomerCode.SelectedValue);
cust.GetCustomerByID();
rvCustomerBal.Enabled = false;
if (hdnInvId.Value == "0")
{
if (cust.Cus_CreditTotal < 0)
{
//rvCustomerBal.MinimumValue = (cust.Cus_CreditTotal).ToString();
//decimal.Round((receiveGoods.TotalAmount - receiveGoods.TotalPaid), 2).ToString();
}
txtCustomerCredBal.Text = Decimal.Round(cust.Cus_CreditTotal, 2).ToString();
}
break;
case "2"://GRN
btnCheckGRNId.Enabled = true;
break;
default:
break;
}
}
catch (Exception ex)
{
throw ex;
}
}
示例5: ddlCustomer_SelectedIndexChanged
protected void ddlCustomer_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
Customer cus = new Customer();
if (ddlCustomer.Items.Count > 0 && ddlCustomer.SelectedValue.Trim() != "-1")
{
if (ddlCustomer.SelectedValue.Trim() != "1")//cash customer
{
cus.CustomerID = Int32.Parse(ddlCustomer.SelectedValue.Trim());
cus.GetCustomerByID();
Decimal creditSum = Decimal.Round(cus.Cus_CreditTotal, 2);
if (creditSum < 0)//has a debit total
{
creditSum = Decimal.Negate(creditSum);
txtAmmount.Text = creditSum.ToString();
txtAmmount.ReadOnly = true;
}
else
{
txtAmmount.Text = "Cannot Pay";
txtAmmount.ReadOnly = true;
}
}
else
{
txtAmmount.ReadOnly = false;
txtAmmount.Text = String.Empty;
}
}
else
{
txtAmmount.ReadOnly = false;
}
}
catch (Exception ex)
{
ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void ddlCustomer_SelectedIndexChanged(object sender, EventArgs e)");
if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty)
Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false);
else
Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false);
}
}
示例6: SetData
/// <summary>
/// Load the data for GRN Edit / View
/// </summary>
private void SetData()
{
try
{
if (ObjGRN.POId.HasValue)
{
hdnGRNType.Value = "1";//PO used in client side
lblGRNType.Text = "Purchase Order";
int poId = ObjGRN.POId.Value;
PO po = new PO();
po.POId = poId;
po.GetPOByID();
lblSupplierName.Text = po.SupplierName;
}
else if (ObjGRN.InvId.HasValue)//Sales return used in client side
{
hdnGRNType.Value = "2";
lblGRNType.Text = "Sales Return";
lblTitle.Text = "GRN - Credit Note";
}
lblGRNNo.Text = ObjGRN.GRNId.ToString();
hdnPOId.Value = ObjGRN.POId.ToString().Trim();
lblPOCode.Text = ObjGRNPO.POCode;
lblPOAmount.Text = Decimal.Round(ObjGRNPO.POAmount, 2).ToString();
lblDate.Text = ObjGRN.Rec_Date.ToString("dd-MMM-yyyy");
if (ObjGRN.GRNInvoice.InvoiceNo != null)
{
lblInvoiceNo.Text = ObjGRN.GRNInvoice.InvoiceNo.Trim();
Customer cust = new Customer();
cust.CustomerID = ObjGRN.GRNInvoice.CustomerID.Value;
cust.GetCustomerByID();
lblCustomerName.Text = cust.Cus_Name;
lblCustomerCode.Text = cust.CustomerCode;
}
else
{
lblInvoiceNo.Text = String.Empty;
}
lblInvoiceTotal.Text = Decimal.Round(ObjGRN.GRNInvoice.GrandTotal, 2).ToString();
txtCreditNote.InnerHtml = ObjGRN.CreditNote.Trim();
lblSupplierInvNo.Text = ObjGRN.SuplierInvNo.Trim();
lblReceivedTotal.Text = Decimal.Round(ObjGRN.TotalAmount, 2).ToString();
gvItemList.DataSource = ObjGRN.GRNItems;
gvItemList.DataBind();
}
catch (Exception ex)
{
throw ex;
}
}