private void BindData() { string time0 = Request.QueryString["dt1"].Trim(); string time1 = Request.QueryString["dt2"].Trim(); string depart = Request.QueryString["depart"].Trim(); string zeren = Request.QueryString["zeren"].Trim(); CW_ShouKuanBU sk1 = new CW_ShouKuanBU(); DataSet ds1 = sk1.GetShoukuanBillBySearchData(time0, time1, depart, zeren, 0); DataView dv = ds1.Tables[0].DefaultView; dv.Sort = "danwei"; this.GridView1.DataSource = ds1; this.GridView1.DataBind(); string ids = ""; foreach (DataRow dr in ds1.Tables[0].Rows) { ids = ids + dr["zcid"].ToString(); ids = ids + ","; } //Response.Write(ids); DataSet ds2 = sk1.GetShoukuanBillBySearchData(time0, time1, depart, zeren, 1); this.GridView2.DataSource = ds2; this.GridView2.DataBind(); }
private void BindData() { List <SearchField> list1 = (List <SearchField>)ViewState["SearchCondition"]; string kind = ViewState["SearchKind"].ToString(); CW_ShouKuanBU shoukuan1 = new CW_ShouKuanBU(); DataSet ds = shoukuan1.GetBillList(kind, list1, true); shoukuan1.Close(); if (kind == "0" || kind == "1") { if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].NewRow(); dr["danwei1"] = "合计"; dr["bxhj"] = "0"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr["bxhj"] = double.Parse(dr["bxhj"].ToString()) + double.Parse(ds.Tables[0].Rows[i]["bxhj"].ToString()); } ds.Tables[0].Rows.Add(dr); } } this.GridView1.DataSource = ds; this.GridView1.DataBind(); }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { string id = this.GridView1.DataKeys[e.RowIndex].Value.ToString(); if (id != "") { CW_ShouKuanBU sk1 = new CW_ShouKuanBU(); sk1.DelShoukuanDJ(id); sk1.Close(); this.BindData(); } }
private void BindData1() { CW_ShouKuanBU sk1 = new CW_ShouKuanBU(); if (Request["zcid"] != null && Request["zcid"].ToString() != "") { DataSet ds1 = sk1.GetBillByID("0", Request["zcid"].ToString()); if (ds1.Tables[0].Rows.Count > 0) { DataRow dr = ds1.Tables[0].NewRow(); dr["danwei1"] = "合计"; dr["bxhj"] = "0"; for (int j = 0; j < ds1.Tables[0].Rows.Count; j++) { if (ds1.Tables[0].Rows[j]["bxhj"].ToString() != "" && ds1.Tables[0].Rows[j]["bxhj"] != null) { dr["bxhj"] = double.Parse(dr["bxhj"].ToString()) + double.Parse(ds1.Tables[0].Rows[j]["bxhj"].ToString()); } } ds1.Tables[0].Rows.Add(dr); } this.GridView1.DataSource = ds1; this.GridView1.DataBind(); } if (Request["bid"] != null && Request["bid"].ToString() != "") { DataSet ds2 = sk1.GetBillByID("2", Request["bid"].ToString()); if (ds2.Tables[0].Rows.Count > 0) { DataRow dr = ds2.Tables[0].NewRow(); dr["bname"] = "合计"; dr["bxhj"] = "0"; for (int j = 0; j < ds2.Tables[0].Rows.Count; j++) { if (ds2.Tables[0].Rows[j]["bxhj"].ToString() != "" && ds2.Tables[0].Rows[j]["bxhj"] != null) { dr["bxhj"] = double.Parse(dr["bxhj"].ToString()) + double.Parse(ds2.Tables[0].Rows[j]["bxhj"].ToString()); } } ds2.Tables[0].Rows.Add(dr); } this.GridView2.DataSource = ds2; this.GridView2.DataBind(); } }
//审核单据 protected void SaveDataClick(object sender, EventArgs e) { CW_ShouKuanBU shoukuan1 = new CW_ShouKuanBU(); bool check1 = shoukuan1.CheckBill(Request.QueryString["id"], User.Identity.Name); shoukuan1.Close(); if (check1) { Comm.ShowInfo("提示:审核单据成功!", Application["root"] + "/Caiwu/CheckShouKuanList.aspx"); } else { Comm.ShowInfo("提示:审核单据失败,请重新审核!", Request.RawUrl); } }
private void BindData() { string time0 = Request.QueryString["dt1"]; string time1 = Request.QueryString["dt2"]; string depart = Request.QueryString["depart"]; string zeren = Request.QueryString["zeren"]; CW_ShouKuanBU sk1 = new CW_ShouKuanBU(); DataSet ds1 = sk1.GetShoukuanBillBySearchData(time0, time1, depart, zeren, 0); this.GridView1.DataSource = ds1; this.GridView1.DataBind(); DataSet ds2 = sk1.GetShoukuanBillBySearchData(time0, time1, depart, zeren, 1); this.GridView2.DataSource = ds2; this.GridView2.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CW_ShouKuanBU shoukuan1 = new CW_ShouKuanBU(); Hashtable ht = shoukuan1.GetObjectByID(Request.QueryString["id"]); 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"); } this.pbj.Text = Comm.GetNumberFormat(this.pbj.Text); this.plx.Text = Comm.GetNumberFormat(this.plx.Text); shoukuan1.Close(); 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;"; } //会计和出纳和修改单据的信息 U_RolesBU role1 = new U_RolesBU(); bool caiwu = role1.isRole(new string[] { "会计", "出纳" }); role1.Close(); if (caiwu == false) { this.Button3.Visible = false; } } }