protected void SaveDataClick(object sender, EventArgs e) { Hashtable ht = new Hashtable(); string[] arr1 = new string[] { "bill", "billtime", "bname", "bzeren", "remark", "billmen", "fee1", "fee2", "fee3", "fee4", "fee5", "fee6", "fee7", "fee8", "fee9", "fee10", "fee11", "fee12" }; for (int i = 0; i < arr1.Length; i++) { object obj1 = Util.GetControlValue(this.billmen.Parent.FindControl(arr1[i])); if (obj1 != null && obj1.ToString().Trim() != "") { ht.Add(arr1[i], obj1); } } ht.Add("bid", Request.QueryString["bid"]); try { CW_Pay1BU Pay1 = new CW_Pay1BU(); bool result = Pay1.InsertData(ht); Pay1.Close(); if (result) { PubComm.ShowInfo("【增加支出单据】操作成功!", Application["root"] + "/Caiwu/ZcBaoSearch.aspx"); } } catch { PubComm.ShowInfo("【增加支出单据】操作失败,可能的原因是单据编号重复,请重新输入!", Request.RawUrl); } }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { string id = this.GridView1.DataKeys[e.RowIndex].Value.ToString(); if (id != "") { CW_Pay1BU pay1 = new CW_Pay1BU(); pay1.DelPayDJ(id); pay1.Close(); this.BindData(); } }
protected void SaveDataClick(object sender, EventArgs e) { CW_Pay1BU pay1 = new CW_Pay1BU(); bool check1 = pay1.CheckBill(Request.QueryString["id"], User.Identity.Name); pay1.Close(); if (check1) { PubComm.ShowInfo("提示:审核单据成功!", Application["root"] + "/Caiwu/CheckPayList1.aspx"); } else { PubComm.ShowInfo("提示:审核单据失败,请重新审核!", Request.RawUrl); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { this.billtime.Text = DateTime.Now.ToString("yyyy-M-d"); this.billmen.Text = User.Identity.Name; U_ZCBAOBU zcb1 = new U_ZCBAOBU(); DataSet ds = zcb1.GetDetailByID(Request["bid"].ToString(), "Bname,Bzeren"); zcb1.Close(); if (ds.Tables[0].Rows.Count > 0) { Util.SetControlValue(bname, ds.Tables[0].Rows[0]["Bname"]); Util.SetControlValue(bzeren, ds.Tables[0].Rows[0]["Bzeren"]); CW_Pay1BU Pay1 = new CW_Pay1BU(); this.bill.Text = Pay1.GetBillNum(); Pay1.Close(); } this.billtime.Attributes["onfocus"] = "setday(this)"; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CW_Pay1BU pay1 = new CW_Pay1BU(); Hashtable ht = pay1.GetObjectByID(Request.QueryString["id"]); pay1.Close(); for (int i = 0; i < arr1.Length; i++) { Util.SetControlValue(this.bill.Parent.FindControl(arr1[i]), ht[arr1[i]]); } if (this.billtime.Text != "" && this.billtime.Text != null) { this.billtime.Text = DateTime.Parse(this.billtime.Text).ToString("yyyy-M-d"); } for (int j = 0; j < arr2.Length; j++) { Label lab1 = this.bill.Parent.FindControl(arr2[j]) as Label; if (lab1 != null) { lab1.Text = PubComm.GetNumberFormat(lab1.Text); } } if (ht["checktime"] != DBNull.Value) { this.Button1.Visible = false; this.Button2.Attributes["onclick"] = "history.go(-1);return false;"; } else { this.Button2.Attributes["onclick"] = "top.location.href='CheckShouKuanList.aspx';return false;"; } } }