protected void Page_Load(object sender, EventArgs e) { //RegistryKey pregkey; //pregkey = Registry.CurrentUser.OpenSubKey("Software//Microsoft//Internet Explorer//PageSetup//", false); if (!IsPostBack) { if (Session["ElectronicInvoice"] != null) { var model = Session["ElectronicInvoice"] as ElectronicInvoice; txtPrNo.Text = model.ProNo; txtDate.Text = string.Format("{0:yyyy MM dd}", DateTime.Now); txtShouKuanRen.Text = model.SupplieSimpeName; txtTotal.Text = string.Format("¥{0:n2}", model.ActPay); txtUse.Text = model.Use; txtDaShouKuan.Text = model.SupplierName; txtDaTotal.Text = RMBCapitalization.RMBAmount(Convert.ToDouble(model.ActPay.ToString("f2"))); txtDaUse.Text = model.Use; txtDaNum.Text = "¥" + model.ActPay.ToString("f2").Replace(".", ""); txtDaDate.Text = ConvertNum(DateTime.Now.Year.ToString()) + " " + (DateTime.Now.Month > 9 ? "" : "零") + ConvertMoney(DateTime.Now.Month).Replace("圆整", "") + " " + (DateTime.Now.Day > 9 ? "" : "零") + ConvertMoney(DateTime.Now.Day).Replace("圆整", ""); if (!string.IsNullOrEmpty(model.Person)) { var person = new Invoice_PersonService().GetListArray(string.Format(" name='{0}'", model.Person))[0]; txtDaRemark.Text = person.CardNo; } } } }
/// <summary> /// 获取人民币大写金额字符串 /// </summary> /// <param name="value"></param> /// <returns></returns> private string GetRMBConvert(decimal value) { RMBCapitalization RMBConvert = new RMBCapitalization(); string invoiceAmtConv = RMBConvert.RMBAmount(value); return(invoiceAmtConv + string.Format("(¥{0})", value.ToString("#########0.00"))); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["ElectronicInvoice"] != null) { var model = Session["ElectronicInvoice"] as ElectronicInvoice; txtCompanyName.Text = model.Company; txtRightCompanyName.Text = model.Company; txtSupplierName.Text = model.SupplierName; txtRightSupplierName.Text = model.SupplierName; txtSupplierCardNo.Text = model.SupplierBrandNo; txtRightSupplierCardNo.Text = model.SupplierBrandNo; txtBrandName.Text = model.SupplierBrandName; txtRightBrandName.Text = model.SupplierBrandName; txtNum.Text = "¥" + model.ActPay.ToString("f2").Replace(".", ""); txtDaTotal.Text = RMBCapitalization.RMBAmount(Convert.ToDouble(model.ActPay)); txtUse.Text = model.ProNo; txtTotal.Text = "¥" + string.Format("{0:n2}", model.ActPay); TB_CompanyService companySer = new TB_CompanyService(); var companyModel = companySer.GetListArray(string.Format(" ComName='{0}'", model.Company))[0]; txtCardNo.Text = companyModel.KaHao; txtRightCompanyCardNo.Text = companyModel.KaHao; TB_SupplierInfoService supplierSer = new TB_SupplierInfoService(); var list = supplierSer.GetListArray(string.Format(" SupplierName='{0}'", model.SupplierName)); if (list.Count > 0) { var supplierModel = list[0]; txtBrandAddress.Text = (string.IsNullOrEmpty(supplierModel.Province) ? " " : supplierModel.Province) + " " + supplierModel.City; txtRightBrandAddress.Text = (string.IsNullOrEmpty(supplierModel.Province) ? " " : supplierModel.Province) + " " + supplierModel.City; } else { txtBrandAddress.Text = ""; txtRightBrandAddress.Text = ""; } if (!string.IsNullOrEmpty(model.Person)) { var person = new Invoice_PersonService().GetListArray(string.Format(" name='{0}'", model.Person))[0]; txtId.Text = person.CardNo; txtRightPhone.Text = person.Phone; txtPhone.Text = person.Phone; } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["ElectronicInvoice"] != null) { var model = Session["ElectronicInvoice"] as ElectronicInvoice; txtDate.Text = string.Format("{0:yyyy MM dd}", DateTime.Now); txtSupplierName.Text = model.SupplierName; txtSupplierCardNo.Text = model.SupplierBrandNo; txtSupplierBrandName.Text = model.SupplierBrandName; txtNum.Text = "¥" + model.ActPay.ToString("f2").Replace(".", ""); txtDaTotal.Text = RMBCapitalization.RMBAmount(Convert.ToDouble(model.ActPay.ToString("f2"))); txtUse.Text = model.ProNo; TB_CompanyService companySer = new TB_CompanyService(); var companyModel = companySer.GetListArray(string.Format(" ComName='{0}'", model.Company))[0]; txtCompanyName.Text = model.Company; txtCompanyCardNo.Text = companyModel.KaHao; txtCompanyBrandName.Text = companyModel.KaiHuHang; } }