/// <summary> /// 加载开票信息 /// </summary> private void Record_Load() { string Id = Request.QueryString["Id"]; if (!string.IsNullOrEmpty(Id)) { EtNet_Models.InvoiceRecord model = InvoiceRecordManager.GetModel(int.Parse(Id)); txtInvoiceDate.Text = model.recordDate.ToString("yyyy-MM-dd"); lblAmount.Text = model.amount.ToString("F2"); hidAmount.Value = model.amount.ToString(); txtUnit.Text = model.cusName; hidComID.Value = model.cusId.ToString(); txtRemakr.Text = model.makeRemark; lblRecordDate.Text = model.makeDate.ToString("yyyy-MM-dd"); lblRecordMan.Text = model.makeMan; RecordDetail_Load(Id); } }
/// <summary> /// 保存数据 /// </summary> private void Save() { string Id = Request.QueryString["Id"]; if (!string.IsNullOrEmpty(Id)) { EtNet_Models.InvoiceRecord model = InvoiceRecordManager.GetModel(int.Parse(Id)); model.recordDate = DateTime.Parse(txtInvoiceDate.Text); model.makeRemark = txtRemakr.Text; model.amount = double.Parse(hidAmount.Value); bool result = InvoiceRecordManager.Update(model); if (result) { SaveDetail(int.Parse(Id)); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "success", "alert('保存成功');self.location.href='RecordList.aspx';", true); } } }
/// <summary> /// 保存开票信息 /// </summary> private void Save() { EtNet_Models.InvoiceRecord model = new EtNet_Models.InvoiceRecord(); LoginInfo currentUser = Session["login"] as LoginInfo; model.recordDate = DateTime.Parse(txtInvoiceDate.Text); model.makeDate = DateTime.Now; model.makeMan = currentUser.Cname; model.makeId = currentUser.Id; model.makeRemark = txtRemakr.Text; model.amount = double.Parse(hidAmount.Value); model.cusId = int.Parse(hidComID.Value); model.cusName = txtUnit.Text; int id = InvoiceRecordManager.Add(model); if (id > 0) { SaveDetail(id); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "success", "alert('保存成功');self.location.href='RecordList.aspx';", true); } }