private void bindDatasource() { string sqlstr = ""; sqlstr += Session["query"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; string ids = LoginDataLimitManager.GetLimit(login.Id); if (string.IsNullOrEmpty(ids)) { sqlstr += " and invoiceCMan = " + login.Id; } else { sqlstr += " and invoiceCMan in (" + ids + "," + login.Id + ")"; } SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 016); if (sps == null) { Data data = new Data(); DataSet ds = data.DataPage("to_Invoice", "Id", "*", sqlstr, "Id", true, 5, 5, pages); rpInvoice.DataSource = ds; rpInvoice.DataBind(); } else { Data data = new Data(); DataSet ds = data.DataPage("to_Invoice", "Id", "*", sqlstr, "Id", true, sps.Pageitem, sps.Pagecount, pages); rpInvoice.DataSource = ds; rpInvoice.DataBind(); } }
protected void mgbtnreset_Click(object sender, ImageClickEventArgs e) { string sqlstr = ""; Session["query"] = null; LoginInfo login = (LoginInfo)Session["login"]; string ids = LoginDataLimitManager.GetLimit(login.Id); if (string.IsNullOrEmpty(ids)) { sqlstr += " and madefrom = " + login.Id; } else { sqlstr += " and madefrom in (" + ids + "," + login.Id + ")"; } SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 010); if (sps == null) { Data data = new Data(); DataSet ds = data.DataPage("Company", "Id", "*", sqlstr, "Id", true, 5, 5, pages); comList.DataSource = ds; comList.DataBind(); } else { Data data = new Data(); DataSet ds = data.DataPage("Company", "Id", "*", sqlstr, "Id", true, sps.Pageitem, sps.Pagecount, pages); comList.DataSource = ds; comList.DataBind(); } }
///// <summary> ///// 加载收款单位 ///// </summary> //private void LoadColUnit() //{ // this.collectUnit.Items.Clear(); // this.collectUnit.Items.Add(new ListItem("——请选择——", "0")); // IList<Customer> customers = CustomerManager.getCustomerAll(); // foreach (Customer customer in customers) // { // ListItem adItem = new ListItem(); // adItem.Value = customer.Id.ToString(); // adItem.Text = customer.CusshortName; // this.collectUnit.Items.Add(adItem); // } //} /// <summary> /// 加载订单数据 /// </summary> private void LoadInvoiceRecordList() { LoginInfo login = Session["login"] as LoginInfo; string sql = " "; sql += Session["query"]; EtNet_BLL.DataPage.Data data = new EtNet_BLL.DataPage.Data(); AspNetPager1.RecordCount = data.GetCount("InvoiceRecord", sql); SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 032); if (sps == null) { AspNetPager1.NumericButtonCount = 5; AspNetPager1.PageSize = 5; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable dt = data.GetList("InvoiceRecord", "makeDate", "asc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sql); this.payRepeater.DataSource = dt; this.payRepeater.DataBind(); }
protected void imgbtnsave_Click(object sender, ImageClickEventArgs e) { LoginInfo login = (LoginInfo)Session["login"]; string pagenum = Request.QueryString["pagenum"].ToString(); SearchPageSet pageset = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, Convert.ToInt32(pagenum)); SearchPageSet sps = new SearchPageSet(); sps.Ownersid = ((LoginInfo)Session["login"]).Id; sps.Pagecount = Convert.ToInt32(this.tbxcount.Text.ToString()); sps.Pageitem = Convert.ToInt32(this.tbxitem.Text.ToString()); sps.Pagenum = pagenum; if (pageset == null) { int count = SearchPageSetManager.addSearchPageSet(sps); if (count > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "", true); } } else { sps.Id = pageset.Id; int count = SearchPageSetManager.updateSearchPageSet(sps); if (count > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "", true); } } }
/// <summary> /// 绑定收款列表 /// </summary> private void Load_IncomeList() { double zje = 0; string sqlstr = ""; sqlstr += Session["query"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 035); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } Data data = new Data(); AspNetPager1.RecordCount = data.GetCount("To_Income", sqlstr); DataTable dt = data.GetList("To_Income", "comeDate", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); inList.DataSource = dt; inList.DataBind(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { zje += dt.Rows[i]["comeMoney"].ToString() == "" ? 0.00 : Convert.ToDouble(dt.Rows[i]["comeMoney"]); } } this.zje.Text = zje.ToString("0.00"); }
/// <summary> /// 绑定付费列表数据 /// </summary> private void BindPaymentList() { LoginInfo login = (LoginInfo)Session["login"]; string sqlstr = ""; sqlstr += FilterSql; string ids = LoginDataLimitManager.GetLimit(login.Id); if (string.IsNullOrEmpty(ids)) { sqlstr += " and makerID = " + login.Id; } else { sqlstr += " and makerID in (" + ids + ")"; } SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 017); Data data = new Data(); if (sps == null) { DataSet ds = data.DataPage("View_PaymentList", "id", "*", sqlstr, "requestDate", true, 10, 5, pages); RpPaymentList.DataSource = ds; RpPaymentList.DataBind(); } else { DataSet ds = data.DataPage("View_PaymentList", "id", "*", sqlstr, "requestDate", true, sps.Pageitem, sps.Pagecount, pages); RpPaymentList.DataSource = ds; RpPaymentList.DataBind(); } }
/// <summary> /// 订单列表 /// </summary> private void OrderListBind() { string sqlstr = ""; sqlstr += Session["query"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; sqlstr += " and inputerID = " + login.Id; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 013); Data data = new Data(); AspNetPager1.RecordCount = data.GetCount("ViewOrder", sqlstr); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable dt = data.GetList("ViewOrder", "makerTime", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); cuslist.DataSource = dt; cuslist.DataBind(); LoadZtreeData(); }
/// <summary> /// 加载订单数据 /// </summary> private void LoadOrderList() { if (Session["login"] == null) { Response.Redirect("~/Login.aspx", true); } else { LoginInfo login = Session["login"] as LoginInfo; if (Session["cutPay"].ToString() != "") { string sql = " collectStatus='完成收款' "; sql += Session["cutPay"].ToString(); EtNet_BLL.DataPage.Data data = new EtNet_BLL.DataPage.Data(); SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 033); if (sps != null) { this.j_pagesize.Value = sps.Pageitem.ToString(); this.j_pagecount.Value = sps.Pagecount.ToString(); } this.payRepeater.DataSource = To_OrderInfoManager.GetViewOrderAndCollect("*", sql); this.payRepeater.DataBind(); } } }
/// <summary> /// 加载数据 /// </summary> private void LoadData() { string sqlstr = " "; string tablename = this.cbxFileShow.Checked ? "ViewOrderCollectAmountFile": "ViewOrderCollectAmount"; sqlstr += Session["CollectAmountQuery"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 032); Data data = new Data(); AspNetPager1.RecordCount = data.GetCount(tablename, sqlstr); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable dt = data.GetList(tablename, "cusId", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); rptdata.DataSource = dt; rptdata.DataBind(); //计算金额合计 StringBuilder sqlSelect = new StringBuilder(); sqlSelect.Append("select sum(money) as shouldAmount,sum(collectAmount) as collectAmount,sum(syAmount) as syAmount,sum(countNum) as countamount,sum(adultNum) as adultamount "); string tblname = tablename; DataTable dtSum = data.GetSumMoney(sqlSelect.ToString(), tblname, sqlstr); if (dtSum.Rows.Count > 0) { DataRow dr = dtSum.Rows[0]; shouldamount.InnerText = Convert.IsDBNull(dr["shouldAmount"]) ? "" : Convert.ToDouble(dr["shouldAmount"]).ToString("N2"); hasamount.InnerText = Convert.IsDBNull(dr["collectAmount"]) ? "" : Convert.ToDouble(dr["collectAmount"]).ToString("N2"); syamount.InnerText = Convert.IsDBNull(dr["syAmount"]) ? "" : Convert.ToDouble(dr["syAmount"]).ToString("N2"); countamount.InnerText = Convert.IsDBNull(dr["countamount"]) ? "" : Convert.ToDouble(dr["countamount"]).ToString("N2"); adultamount.InnerText = Convert.IsDBNull(dr["adultamount"]) ? "" : Convert.ToDouble(dr["adultamount"]).ToString("N2"); } //double a = 0; //double b = 0; //double c = 0; //for (int i = 0; i < dt.Rows.Count; i++) //{ // a += Convert.IsDBNull(dt.Rows[i]["money"]) ? 0 : Convert.ToDouble(dt.Rows[i]["money"]); // b += Convert.IsDBNull(dt.Rows[i]["collectAmount"]) ? 0 : Convert.ToDouble(dt.Rows[i]["collectAmount"]); // c += Convert.IsDBNull(dt.Rows[i]["syAmount"]) ? 0 : Convert.ToDouble(dt.Rows[i]["syAmount"]); //} //this.shouldamount.InnerText = a.ToString("F2"); //this.hasamount.InnerText = b.ToString("F2"); //this.syamount.InnerText = c.ToString("F2"); }
/// <summary> /// 加载订单数据 /// </summary> private void LoadOrderCollect() { if (Session["MyOrderQuery"].ToString() != "") { string sqlstr = " and iscancel='N'";//0510 修改作废的订单不显示 sqlstr += Session["MyOrderQuery"].ToString(); if (Session["login"] == null) { Response.Redirect("~/Login.aspx", true); } else { LoginInfo login = (LoginInfo)Session["login"]; //string ids = LoginDataLimitManager.GetLimit(login.Id); //if (string.IsNullOrEmpty(ids)) // sqlstr += " and salemanid = " + login.Id; //else // sqlstr += " and salemanid in (" + ids + ")"; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 034); Data data = new Data(); AspNetPager1.RecordCount = data.GetCount("View_OrderAndClollect", sqlstr); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable dt = data.GetList("View_OrderAndClollect", "outTime", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); orderRepeater.DataSource = dt; orderRepeater.DataBind(); //计算合计 DataTable dtsum = To_OrderInfoManager.GetViewOrderAndCollect(" sum(adultNum) as adult_sum,sum(childNum) as child_sum,sum(withNum) as with_sum,sum(pNum) as pnum_sum,sum(lirun) as lirun_sum,sum(money) as money_sum ", " 1=1 " + sqlstr); if (dtsum.Rows.Count > 0) { this.adult_sum.InnerHtml = dtsum.Rows[0]["adult_sum"].ToString(); this.child_sum.InnerHtml = dtsum.Rows[0]["child_sum"].ToString(); this.with_sum.InnerHtml = dtsum.Rows[0]["with_sum"].ToString(); this.pnum_sum.InnerHtml = dtsum.Rows[0]["pnum_sum"].ToString(); this.lirun_sum.InnerHtml = dtsum.Rows[0]["lirun_sum"].ToString(); this.money_sum.InnerHtml = dtsum.Rows[0]["money_sum"].ToString(); } } } else { orderRepeater.DataSource = null; orderRepeater.DataBind(); this.adult_sum.InnerHtml = this.child_sum.InnerHtml = this.with_sum.InnerHtml = this.pnum_sum.InnerHtml = this.lirun_sum.InnerHtml = this.money_sum.InnerHtml = ""; } }
private void ExpenseListBind() { string sqlstr = " 1=1 "; sqlstr += Session["query"].ToString(); DataTable dt0 = initializeDataTable().Copy(); DataRow[] rows = dt0.Select(sqlstr); DataTable dt = dt0.Clone(); foreach (DataRow row in rows) { dt.ImportRow(row); } LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 210); AspNetPager1.RecordCount = dt.Rows.Count; if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } rptexpens.DataSource = SplitDataTable(dt, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize); rptexpens.DataBind(); #region //string sqlstr = ""; //if (!string.IsNullOrEmpty(Request.QueryString["bankid"])) // sqlstr += " and comebankid = " + Request.QueryString["bankid"]; //sqlstr += Session["query"].ToString(); //LoginInfo login = (LoginInfo)Session["login"]; //SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 210); //Data data = new Data(); //AspNetPager1.RecordCount = data.GetCount("ViewExpense", sqlstr); //if (sps == null) //{ // AspNetPager1.NumericButtonCount = 10; // AspNetPager1.PageSize = 10; //} //else //{ // AspNetPager1.NumericButtonCount = sps.Pagecount; // AspNetPager1.PageSize = sps.Pageitem; //} //DataTable dt = data.GetList("ViewExpense", "comedate", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); //rptexpens.DataSource = dt; //rptexpens.DataBind(); #endregion }
/// <summary> /// 取原有的数据 /// </summary> private void GetData() { LoginInfo login = (LoginInfo)Session["login"]; string pagenum = Request.QueryString["pagenum"].ToString(); SearchPageSet pageset = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, Convert.ToInt32(pagenum)); if (pageset == null) { this.tbxitem.Text = ""; this.tbxcount.Text = ""; } else { this.tbxcount.Text = pageset.Pagecount.ToString(); this.tbxitem.Text = pageset.Pageitem.ToString(); } }
/// <summary> /// 绑定收款单据列表数据 /// </summary> private void BindRpList() { double zje = 0; if (Session["login"] == null) { Response.Redirect("~/Login.aspx", true); } else { LoginInfo login = Session["login"] as LoginInfo; AspNetPager1.RecordCount = To_CollectingManager.GetTotalCount(FilterSql, login.Id); SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 019); if (sps == null) { AspNetPager1.NumericButtonCount = 5; AspNetPager1.PageSize = 5; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } if (HttpContext.Current.Request.QueryString["page"] != null) { AspNetPager1.CurrentPageIndex = int.Parse(HttpContext.Current.Request.QueryString["page"]); } collectingList = To_CollectingManager.GetListByPage(FilterSql, login.Id, AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex); //5.31 增加总计的计算 if (collectingList.Count > 0 && collectingList != null) { foreach (To_Collecting cl in collectingList) { zje += cl.ReceiptAmount.ToString() == "" ? 0.00 : Convert.ToDouble(cl.ReceiptAmount.ToString()); } } RpList.DataSource = collectingList; RpList.DataBind(); this.zje.Text = "¥" + zje.ToString("0.00"); } }
/// <summary> /// 加载数据 /// </summary> private void LoadData() { string unitID = Request.QueryString["unit"]; //付款单位id string sqlstr = " and iscancel = 'N' "; sqlstr += this.cbxFileShow.Checked ? "" : " and fileStatus=0 "; sqlstr += " and factid=" + unitID; sqlstr += Session["payDetailQuery"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 033); Data data = new Data(); AspNetPager1.RecordCount = data.GetCount("View_OrderPayAndReturn", sqlstr); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable dt = data.GetList("View_OrderPayAndReturn", "outTime", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); rptdata.DataSource = dt; rptdata.DataBind(); thissqlstr = sqlstr + " order by outTime desc"; //计算金额合计 StringBuilder sqlSelect = new StringBuilder(); sqlSelect.Append("select sum(money) as shouldAmount,sum(payAmount) as payAmount,sum(syAmount) as syAmount "); string tblname = "View_OrderPayAndReturn"; DataTable dtSum = data.GetSumMoney(sqlSelect.ToString(), tblname, sqlstr); if (dtSum.Rows.Count > 0) { DataRow dr = dtSum.Rows[0]; shouldamount.InnerText = Convert.IsDBNull(dr["shouldAmount"]) ? "" : Convert.ToDouble(dr["shouldAmount"]).ToString("N2"); hasamount.InnerText = Convert.IsDBNull(dr["payAmount"]) ? "" : Convert.ToDouble(dr["payAmount"]).ToString("N2"); syamount.InnerText = Convert.IsDBNull(dr["syAmount"]) ? "" : Convert.ToDouble(dr["syAmount"]).ToString("N2"); } }
/// <summary> /// 绑定 /// </summary> private void bindData() { LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 027); if (sps == null) { EtNet_BLL.DataPage.Data data = new Data(); DataSet ds = data.DataPage("LoginInfo", "id", "*", str, "loginid", false, 10, 10, pages); rploginUser.DataSource = ds; rploginUser.DataBind(); } else { EtNet_BLL.DataPage.Data data = new Data(); DataSet ds = data.DataPage("LoginInfo", "id", "*", str, "loginid", false, sps.Pageitem, sps.Pagecount, pages); rploginUser.DataSource = ds; rploginUser.DataBind(); } }
/// <summary> /// 绑定标的属性列表(repeater控件) /// </summary> private void RpPropertyBindData(int targetTypeId) { TargetPropertyManager tpManager = new TargetPropertyManager(); string where = string.Format("TargetTypeId = {0}", targetTypeId); AspNetPager1.RecordCount = tpManager.GetRecordCount(where); LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 011); if (sps != null) { AspNetPager1.PageSize = sps.Pageitem; AspNetPager1.NumericButtonCount = sps.Pagecount; } else { AspNetPager1.PageSize = 10; AspNetPager1.NumericButtonCount = 10; } rpTargetProperty.DataSource = tpManager.GetListByPage(where, "TargetTypeId", AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex); rpTargetProperty.DataBind(); }
/// <summary> /// 加载付款申请数据 /// </summary> private void LoadPayList() { LoginInfo login = Session["login"] as LoginInfo; if (!string.IsNullOrEmpty(Session["payQuery"].ToString()) || !string.IsNullOrEmpty(Session["query"].ToString()))//--0429 更改 { //} //if (Session["payQuery"].ToString() != "" || Session["query"].ToString() != "")//原方法报错 //{ string sql = " and auditstatus = '04' "; sql += Session["payQuery"]; sql += Session["query"]; EtNet_BLL.DataPage.Data data = new EtNet_BLL.DataPage.Data(); AspNetPager1.RecordCount = data.GetCount("View_PaymentList", sql); SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 040); if (sps == null) { AspNetPager1.NumericButtonCount = 5; AspNetPager1.PageSize = 5; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } //0429 修改 为了排序顺序 // DataTable dt = new EtNet_BLL.RegReimbursementManager().GetListpage(" auditstatus = '04'" + Session["payQuery"] + Session["query"], "regType asc,confirmDate DESC", AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex); DataTable dt = data.GetpageList("View_PaymentList", " regType asc,confirmDate DESC ", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sql); // DataTable dt = data.GetList("View_PaymentList", "isConfirm", "asc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sql);//原方法 this.payRepeater.DataSource = dt; this.payRepeater.DataBind(); } else { this.payRepeater.DataSource = null; this.payRepeater.DataBind(); } }
/// <summary> /// 绑定 /// </summary> private void dataBind() { string sqlstr = ""; sqlstr += Session["query"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; //string ids = LoginDataLimitManager.GetLimit(login.Id); //if (string.IsNullOrEmpty(ids)) //{ // sqlstr += " and madefrom = " + login.Id; //} //else //{ // sqlstr += " and madefrom in (" + ids + "," + login.Id + ")"; //} //sqlstr += " AND (madefrom = " + login.Id + " OR "; //sqlstr += " ',' + viewidlist + ',' like " + "'%," + login.Id + ",%' )"; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 013); if (sps == null) { Data data = new Data(); DataSet ds = data.DataPage("ViewCustomer", "Id", "*", sqlstr, "Id", true, 10, 15, pages); cuslist.DataSource = ds; cuslist.DataBind(); } else { Data data = new Data(); DataSet ds = data.DataPage("ViewCustomer", "Id", "*", sqlstr, "Id", true, sps.Pageitem, sps.Pagecount, pages); cuslist.DataSource = ds; cuslist.DataBind(); } }
/// <summary> /// 订单列表 /// </summary> private void OrderListBind() { string sqlstr = this.checkfile.Checked ? " " : " and fileStatus=0 "; sqlstr += Session["query"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; string ids = LoginDataLimitManager.GetLimit(login.Id); if (string.IsNullOrEmpty(ids)) { sqlstr += " and (markid = " + login.Id + " or inputerId= " + login.Id + ") "; } else { sqlstr += " and (inputerId in (" + ids + ") or markid= " + login.Id + ") ";//0419修改,将查看数据权限更改为可查看操作员数据 } //sqlstr += " or inputerID = " + login.Id; //操作员也能看到其对应的订单信息 SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 013); Data data = new Data(); AspNetPager1.RecordCount = data.GetCount("ViewOrder", sqlstr); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable dt = data.GetList("ViewOrder", "makerTime", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); cuslist.DataSource = dt; cuslist.DataBind(); LoadZtreeData(); }
private void dataBind() { LoginInfo currentLogin = Session["login"] as LoginInfo; int pitem = 0; int pcount = 0; SearchPageSet set = SearchPageSetManager.getSearchPageSetByLoginId(currentLogin.Id, 024); if (set != null) { pitem = set.Pageitem; pcount = set.Pagecount; } else { pitem = 10; pcount = 10; } EtNet_BLL.DataPage.Data data = new Data(); DataSet ds = data.DataPage("IncomeType", "id", "*", "", "id", true, pitem, pcount, pages); typeList.DataSource = ds; typeList.DataBind(); }
/// <summary> /// 加载通讯录数据 /// </summary> private void LoadAddressList() { string sqlstr = ""; sqlstr += Session["query"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 002); if (sps == null) { Data data = new Data(); DataSet ds = data.DataPage("ViewAddressList", "Id", "*", sqlstr, "Id", true, 5, 5, pages); rptdata.DataSource = ds; rptdata.DataBind(); } else { Data data = new Data(); DataSet ds = data.DataPage("ViewAddressList", "Id", "*", sqlstr, "Id", true, sps.Pageitem, sps.Pagecount, pages); rptdata.DataSource = ds; rptdata.DataBind(); } }
/// <summary> /// 加载数据 /// </summary> private void RpPolicyBindData() { AspNetPager1.RecordCount = To_PolicyManager.GetCount(FilterSql, (Session["login"] as LoginInfo).Id) ?? 0; LoginInfo login = Session["login"] as LoginInfo; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 015); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable dtPolicy = To_PolicyManager.GetListByPage(null, (Session["login"] as LoginInfo).Id, "", FilterSql, AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex); RpPolicy.DataSource = dtPolicy; RpPolicy.DataBind(); }
/// <summary> /// 绑定付费列表数据 /// </summary> private void BindPaymentList() { double zje = 0; LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 020); string sql = " and isconfirm = 1"; sql += FilterSql; Data data = new Data(); AspNetPager1.RecordCount = data.GetCount("View_PaymentList", sql); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } //0419,修改首页列表中未支付优先显示 //DataTable dt = new EtNet_BLL.RegReimbursementManager().GetListpage(" isconfirm = 1" + FilterSql, "regType asc,requestDate DESC", AspNetPager1.StartRecordIndex, AspNetPager1.CurrentPageIndex); //原方法 DataTable dt = data.GetList("View_PaymentList", " regType"," DESC ", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sql); //0512 修改存储过程之后 多条件排序方法 DataTable dt = data.GetpageList("View_PaymentList", " regType asc,requestDate DESC ", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sql); for (int i = 0; i < dt.Rows.Count; i++) { zje += dt.Rows[i]["totalAmount"].ToString() == "" ? 0.00 : Convert.ToDouble(dt.Rows[i]["totalAmount"]); } RpPaymentList.DataSource = dt; RpPaymentList.DataBind(); this.zje.Text = zje.ToString("0.00"); }
/// <summary> /// 绑定收款单据列表数据 /// </summary> private void BindRpList() { LoginInfo login = Session["login"] as LoginInfo; AspNetPager1.RecordCount = To_CollectingManager.GetTotalCountByLimit(FilterSql + " AND confirmReceipt=1 ", login.Id); SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 018); if (sps == null) { AspNetPager1.NumericButtonCount = 5; AspNetPager1.PageSize = 5; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable data = To_CollectingManager.GetListByLimit(FilterSql + " AND confirmReceipt=1 ", login.Id, AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex); RpList.DataSource = data; RpList.DataBind(); }
protected void mgbtnreset_Click1(object sender, ImageClickEventArgs e) { string sqlstr = ""; sqlstr += Session["query"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; string ids = LoginDataLimitManager.GetLimit(login.Id); if (string.IsNullOrEmpty(ids)) { sqlstr += " and invoiceCMan = " + login.Id; } else { sqlstr += " and invoiceCMan in (" + ids + "," + login.Id + ")"; } SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 016); if (sps == null) { Data data = new Data(); DataSet ds = data.DataPage("to_Invoice", "Id", "*", sqlstr, "Id", true, 5, 5, pages); rpInvoice.DataSource = ds; rpInvoice.DataBind(); } else { Data data = new Data(); DataSet ds = data.DataPage("to_Invoice", "Id", "*", sqlstr, "Id", true, sps.Pageitem, sps.Pagecount, pages); rpInvoice.DataSource = ds; rpInvoice.DataBind(); } this.txtBeginDate.Value = ""; this.txtEndDate.Value = ""; this.txtInvoiceID.Value = ""; this.txtPrice.Value = ""; this.txtUnit.Value = ""; }
/// <summary> /// 加载数据 /// </summary> private void LoadData() { Stopwatch stpwth = new Stopwatch(); stpwth.Start(); string sqlstr = " and iscancel = 'N' "; sqlstr += this.cbxFileShow.Checked ? "" : " and fileStatus=0 "; sqlstr += Session["orderGrossQuery"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 036); // 20200226优化毛利表打不开,将直接查询视图数据,改为查询出来数据后程序做统计 ViewOrderGrossList 这张视图不用了 Data data = new Data(); // 配置分页信息 分页用程序分页了,不通过数据库查询 AspNetPager1.RecordCount = data.GetCount("ViewOrder", sqlstr); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } // 获取指定条件的所有订单信息 DataTable orderTbl = To_OrderInfoManager.GetTableInfo("ViewOrder", "orderNum,id,outTime,teamNum,natrue,gross,codenum,auditstutastxt,line,iscancel,inputer,inputerID,departautocode,fileStatus", sqlstr + "order by outTime asc"); // 订单支付信息 DataTable payTbl = To_OrderInfoManager.GetTableInfo("ViewOrderPayMoney", "orderid,money,payAmount,syAmount", "and orderid in (select id from ViewOrder where 1=1 " + sqlstr + ")"); // 订单收款信息 DataTable colTbl = To_OrderInfoManager.GetTableInfo("ViewOrderCollectMoney", "orderid,money,collectAmount,syAmount,collectStatus", "and orderid in (select id from ViewOrder where 1=1 " + sqlstr + ")"); // 订单退款信息 DataTable refuTbl = To_OrderInfoManager.GetTableInfo("ViewOrderRefuMoney", "orderid,money,refundAmount,syAmount", "and orderid in (select id from ViewOrder where 1=1 " + sqlstr + ")"); // 订单报销信息 DataTable reimTbl = To_OrderInfoManager.GetTableInfo("ViewOrderReimMoney", "orderId,totalmoney", "and orderid in (select id from ViewOrder where 1=1 " + sqlstr + ")"); // 付款信息的key-value Dictionary <string, DataRow> payMap = new Dictionary <string, DataRow>(); for (int i = 0; i < payTbl.Rows.Count; i++) { payMap.Add(payTbl.Rows[i]["orderid"].ToString(), payTbl.Rows[i]); } // 收款信息的key-value Dictionary <string, DataRow> colMap = new Dictionary <string, DataRow>(); for (int i = 0; i < colTbl.Rows.Count; i++) { colMap.Add(colTbl.Rows[i]["orderid"].ToString(), colTbl.Rows[i]); } // 退款信息的key-value Dictionary <string, DataRow> refuMap = new Dictionary <string, DataRow>(); for (int i = 0; i < refuTbl.Rows.Count; i++) { refuMap.Add(refuTbl.Rows[i]["orderid"].ToString(), refuTbl.Rows[i]); } // 报销信息的key-value Dictionary <string, DataRow> reimMap = new Dictionary <string, DataRow>(); for (int i = 0; i < reimTbl.Rows.Count; i++) { reimMap.Add(reimTbl.Rows[i]["orderId"].ToString(), reimTbl.Rows[i]); } // 合计信息 double collectShouldSum = 0, collectAmountSum = 0, collectSySum = 0, payShouldSum = 0, payAmountSum = 0, paySySum = 0, refuShouldSum = 0, refundAmountSum = 0, refuSySum = 0, reimShouldSum = 0, grossBxSum = 0; // 生成最终的毛利表信息 orderTbl.Columns.Add("payShould"); orderTbl.Columns.Add("payAmount"); orderTbl.Columns.Add("paySy"); orderTbl.Columns.Add("collectShould"); orderTbl.Columns.Add("collectAmount"); orderTbl.Columns.Add("collectSy"); orderTbl.Columns.Add("collectStatus"); orderTbl.Columns.Add("refuShould"); orderTbl.Columns.Add("refundAmount"); orderTbl.Columns.Add("refuSy"); orderTbl.Columns.Add("reimShould"); orderTbl.Columns.Add("gross_bx"); for (int i = 0; i < orderTbl.Rows.Count; i++) { string orderId = orderTbl.Rows[i]["id"].ToString(); double gross_bx = 0; if (payMap.ContainsKey(orderId)) { DataRow payRow = payMap[orderId]; orderTbl.Rows[i]["payShould"] = payRow["money"]; // 应付款 orderTbl.Rows[i]["payAmount"] = payRow["payAmount"]; // 付款合计 orderTbl.Rows[i]["paySy"] = payRow["syAmount"]; // 付款剩余 payShouldSum += Convert.IsDBNull(payRow["money"]) ? 0 : Convert.ToDouble(payRow["money"]); payAmountSum += Convert.IsDBNull(payRow["payAmount"]) ? 0 : Convert.ToDouble(payRow["payAmount"]); paySySum += Convert.IsDBNull(payRow["syAmount"]) ? 0 : Convert.ToDouble(payRow["syAmount"]); gross_bx -= Convert.IsDBNull(payRow["money"]) ? 0 : Convert.ToDouble(payRow["money"]); } if (colMap.ContainsKey(orderId)) { DataRow colRow = colMap[orderId]; orderTbl.Rows[i]["collectShould"] = colRow["money"]; // 应收款 orderTbl.Rows[i]["collectAmount"] = colRow["collectAmount"]; // 收款合计 orderTbl.Rows[i]["collectSy"] = colRow["syAmount"]; // 收款剩余 orderTbl.Rows[i]["collectStatus"] = colRow["collectStatus"]; // 收款状态 collectShouldSum += Convert.IsDBNull(colRow["money"]) ? 0 : Convert.ToDouble(colRow["money"]); collectAmountSum += Convert.IsDBNull(colRow["collectAmount"]) ? 0 : Convert.ToDouble(colRow["collectAmount"]); collectSySum += Convert.IsDBNull(colRow["syAmount"]) ? 0 : Convert.ToDouble(colRow["syAmount"]); gross_bx += Convert.IsDBNull(colRow["money"]) ? 0 : Convert.ToDouble(colRow["money"]); } if (refuMap.ContainsKey(orderId)) { DataRow refuRow = refuMap[orderId]; orderTbl.Rows[i]["refuShould"] = refuRow["money"]; // 应退款 orderTbl.Rows[i]["refundAmount"] = refuRow["refundAmount"]; // 退款合计 orderTbl.Rows[i]["refuSy"] = refuRow["syAmount"]; // 退款剩余 refuShouldSum += Convert.IsDBNull(refuRow["money"]) ? 0 : Convert.ToDouble(refuRow["money"]); refundAmountSum += Convert.IsDBNull(refuRow["refundAmount"]) ? 0 : Convert.ToDouble(refuRow["refundAmount"]); refuSySum += Convert.IsDBNull(refuRow["syAmount"]) ? 0 : Convert.ToDouble(refuRow["syAmount"]); gross_bx += Convert.IsDBNull(refuRow["money"]) ? 0 : Convert.ToDouble(refuRow["money"]); } if (reimMap.ContainsKey(orderId)) { DataRow reimRow = reimMap[orderId]; orderTbl.Rows[i]["reimShould"] = reimRow["totalmoney"]; // 应报销款 reimShouldSum += Convert.IsDBNull(reimRow["totalmoney"]) ? 0 : Convert.ToDouble(reimRow["totalmoney"]); gross_bx -= Convert.IsDBNull(reimRow["totalmoney"]) ? 0 : Convert.ToDouble(reimRow["totalmoney"]); } orderTbl.Rows[i]["gross_bx"] = gross_bx; grossBxSum += gross_bx; } orderGrossList = orderTbl; // 获取排序后的订单信息数据 //DataTable dt = data.GetList("ViewOrderGrossList", "id", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); //rpgrossdata.DataSource = dt; //rpgrossdata.DataBind(); //计算金额合计 scshould.InnerText = collectShouldSum.ToString("N2"); scamount.InnerText = collectAmountSum.ToString("N2"); scsy.InnerText = collectSySum.ToString("N2"); spshould.InnerText = payShouldSum.ToString("N2"); spamount.InnerText = payAmountSum.ToString("N2"); spsy.InnerText = paySySum.ToString("N2"); srshould.InnerText = refuShouldSum.ToString("N2"); sramount.InnerText = refundAmountSum.ToString("N2"); srsy.InnerText = refuSySum.ToString("N2"); sbx.InnerText = reimShouldSum.ToString("N2"); sml.InnerText = grossBxSum.ToString("N2"); stpwth.Stop(); TimeSpan ts = stpwth.Elapsed; bindData(); }
/// <summary> /// 加载数据 /// </summary> private void LoadData() { string unitID = Request.QueryString["unit"]; //收款单位id string sqlstr = " and iscancel = 'N' "; sqlstr += this.cbxFileShow.Checked ? "" : " and fileStatus=0 "; sqlstr += " and cusId=" + unitID; sqlstr += Session["CollectDetailQuery"].ToString(); LoginInfo login = (LoginInfo)Session["login"]; SearchPageSet sps = SearchPageSetManager.getSearchPageSetByLoginId(login.Id, 033); Data data = new Data(); AspNetPager1.RecordCount = data.GetCount("View_OrderAndClollect", sqlstr); if (sps == null) { AspNetPager1.NumericButtonCount = 10; AspNetPager1.PageSize = 10; } else { AspNetPager1.NumericButtonCount = sps.Pagecount; AspNetPager1.PageSize = sps.Pageitem; } DataTable dt = data.GetList("View_OrderAndClollect", "outTime", "desc", AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, sqlstr); rptdata.DataSource = dt; rptdata.DataBind(); thissqlstr = sqlstr + " order by outTime desc"; //计算金额合计 StringBuilder sqlSelect = new StringBuilder(); sqlSelect.Append("select sum(money) as shouldAmount,sum(collectAmount) as collectAmount,sum(syAmount) as syAmount "); string tblname = "View_OrderAndClollect"; DataTable dtSum = data.GetSumMoney(sqlSelect.ToString(), tblname, sqlstr); if (dtSum.Rows.Count > 0) { DataRow dr = dtSum.Rows[0]; shouldamount.InnerText = Convert.IsDBNull(dr["shouldAmount"]) ? "" : Convert.ToDouble(dr["shouldAmount"]).ToString("N2"); hasamount.InnerText = Convert.IsDBNull(dr["collectAmount"]) ? "" : Convert.ToDouble(dr["collectAmount"]).ToString("N2"); syamount.InnerText = Convert.IsDBNull(dr["syAmount"]) ? "" : Convert.ToDouble(dr["syAmount"]).ToString("N2"); } /*计算人数合计*/ StringBuilder sqlNumSelect = new StringBuilder(); sqlNumSelect.AppendFormat("select sum(adultNum) as adultNumAmount,sum(childNum) as childNumAmount,sum(withNum) as withNumAmount "); DataTable dtNum = data.GetSumMoney(sqlNumSelect.ToString(), tblname, sqlstr); if (dtNum.Rows.Count > 0) { DataRow dr = dtNum.Rows[0]; adultNum.InnerText = Convert.IsDBNull(dr["adultNumAmount"]) ? "" : Convert.ToDouble(dr["adultNumAmount"]).ToString("N0"); childNum.InnerText = Convert.IsDBNull(dr["childNumAmount"]) ? "" : Convert.ToDouble(dr["childNumAmount"]).ToString("N0"); withNum.InnerText = Convert.IsDBNull(dr["withNumAmount"]) ? "" : Convert.ToDouble(dr["withNumAmount"]).ToString("N0"); } //double a = 0; //double b = 0; //double c = 0; //for (int i = 0; i < dt.Rows.Count; i++) //{ // a += Convert.IsDBNull(dt.Rows[i]["money"]) ? 0 : Convert.ToDouble(dt.Rows[i]["money"]); // b += Convert.IsDBNull(dt.Rows[i]["collectAmount"]) ? 0 : Convert.ToDouble(dt.Rows[i]["collectAmount"]); // c += ((Convert.IsDBNull(dt.Rows[i]["money"]) ? 0 : Convert.ToDouble(dt.Rows[i]["money"])) - (Convert.IsDBNull(dt.Rows[i]["collectAmount"]) ? 0 : Convert.ToDouble(dt.Rows[i]["collectAmount"]))); //} //this.shouldamount.InnerText = a.ToString("F2"); //this.hasamount.InnerText = b.ToString("F2"); //this.syamount.InnerText = c.ToString("F2"); }