protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int recv = PageTools.ParseInt(Request.QueryString["recv"]); if (recv > 0) { AgentOrderBiz aobiz = new AgentOrderBiz(); DataSet ds = aobiz.GetAgentRecvInvoice(recv); if (ds != null) { int agentID = (int)(ds.Tables[0].Rows[0]["agentID"]); if (agentID > 0) { AdminCompanyBiz biz = new AdminCompanyBiz(); DS_Companys.CompanyDetailDataTable dt = biz.GetCompanyDetail(agentID); if (dt != null && dt.Rows.Count > 0) { DS_Companys.CompanyDetailRow crow = dt.Rows[0] as DS_Companys.CompanyDetailRow; lbAgentName.Text = crow.companyName + " / " + crow.companyName_cn; lbAgentAddress.Text = crow.address + " <br /> " + crow.city + ", " + crow.state + " " + crow.zip + "<br />" + crow.country; lbAgentTel.Text = crow.telephone; lbAgentFax.Text = crow.fax; } } lbCreateDate.Text = ((DateTime)ds.Tables[0].Rows[0]["createDate"]).ToShortDateString(); lbInvoiceNumber.Text = recv.ToString(); } } } }
protected string GetAgentName(object agentID) { if (agentID == null) return string.Empty; AdminCompanyBiz biz = new AdminCompanyBiz(); return biz.GetCompanyNameByID((int)agentID); }