public async Task <IActionResult> GetUser(int id, [FromQuery] PageParameters pageParameters) { int userId; if (User.Identity.IsAuthenticated) { userId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value); } else { userId = 0; } var user = await _repo.GetUserDetails(id, userId, pageParameters); Pagger <UserDetailsPostDto> postToReturn = new Pagger <UserDetailsPostDto>(user.Posts); DetailsUserPaggedDto detailsUserPaggedDto = new DetailsUserPaggedDto() { Login = user.Login, Posts = postToReturn, FirstName = user.FirstName, LastName = user.LastName, Description = user.Description, MainPhotoUrl = user.MainPhotoUrl, AmountFollowers = user.AmountFollowers, AmoutnFollowing = user.AmoutnFollowing, FollowingId = user.FollowingId }; if (user == null) { return(NotFound()); } return(Ok(detailsUserPaggedDto)); }
/// <summary> /// 绑定 /// </summary> public void Bind() { if (this.txtPager.Value.Trim().ToString() != "" && this.txtPager.Value.Trim().ToString() != "0") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 10; this.txtPager.Value = "10"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string strWhere = string.Format("and a.compid={0} and b.compid={0}", this.CompID); if (ViewState["strWhere"] != null) { strWhere += ViewState["strWhere"].ToString(); } Pagger pagger = new Pagger(Returnsql(strWhere.ToString())); Pager.RecordCount = pagger.getDataCount(); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); this.rptGoodsInfo.DataSource = dt; this.rptGoodsInfo.DataBind(); //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$(function(){ $(\"#CB_SelAll\").trigger(\"click\");})</script>"); }
public ActionResult Get(Page model) { ResponseJson response = new ResponseJson() { Data = new List <object>() }; var data = new Pagger <dynamic>(); using (AppDB db = new AppDB()) { response = IEnumerableData.GetPageResponse <StyleModel>(model, (from s in db.Styles join b in db.Buyers on s.BuyerId equals b.Id join st in db.Status on s.Status equals st.Id select new StyleModel() { BarCode = s.BarCode, Buyer = b.Name, BuyerId = s.BuyerId, Id = s.Id, Name = s.Name, Quantity = s.Quantity, Status = st.Name, StatusId = st.Id, ShippingDate = s.ShippingDate, Description = s.Description, YarnType = s.YarnType, Size = s.Size, })); } return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult Get(Page model) { ResponseJson response = new ResponseJson() { Data = new List<object>() }; var data = new Pagger<dynamic>(); using (AppDB db = new AppDB()) { response = IEnumerableData.GetPageResponse<StyleModel>(model, (from s in db.Styles join b in db.Buyers on s.BuyerId equals b.Id join st in db.Status on s.Status equals st.Id select new StyleModel() { BarCode=s.BarCode, Buyer=b.Name, BuyerId=s.BuyerId, Id=s.Id, Name=s.Name, Quantity=s.Quantity, Status=st.Name, StatusId=st.Id, ShippingDate=s.ShippingDate, Description=s.Description, YarnType=s.YarnType, Size=s.Size, })); } return Json(response, JsonRequestBehavior.AllowGet); }
public ActionResult Get(Page model) { ResponseJson response = new ResponseJson() { Data = new List <object>() }; var data = new Pagger <dynamic>(); using (AppDB db = new AppDB()) { response = IEnumerableData.GetPageResponse <BundleModel>(model, (from b in db.Bundles join s in db.Styles on b.StyleId equals s.Id join st in db.Status on b.Status equals st.Id join o in db.Employees on b.OperatorId equals o.Id join l in db.Employees on b.LinkingBy equals l.Id where b.Status == 2 select new BundleModel() { BarCode = b.BarCode, Style = s.Name, StyleId = b.StyleId, Id = b.Id, Quantity = b.Quantity, Status = st.Name, StatusId = st.Id, KnittingMachine = b.KnittingMachine, LinkingEndAt = b.LinkingEndAt, OperatorId = b.OperatorId, Operator = o.Name, LinkingBy = l.Name, LinkingById = l.Id })); } return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult Get(Page model) { ResponseJson response = new ResponseJson() { Data = new List<object>() }; var data = new Pagger<dynamic>(); using (AppDB db = new AppDB()) { response = IEnumerableData.GetPageResponse<BundleModel>(model, (from b in db.Bundles join s in db.Styles on b.StyleId equals s.Id join st in db.Status on b.Status equals st.Id join o in db.Employees on b.OperatorId equals o.Id join l in db.Employees on b.LinkingBy equals l.Id where b.Status == 2 select new BundleModel() { BarCode = b.BarCode, Style = s.Name, StyleId = b.StyleId, Id = b.Id, Quantity = b.Quantity, Status = st.Name, StatusId = st.Id, KnittingMachine = b.KnittingMachine, LinkingEndAt = b.LinkingEndAt, OperatorId = b.OperatorId, Operator = o.Name, LinkingBy = l.Name, LinkingById = l.Id })); } return Json(response, JsonRequestBehavior.AllowGet); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = string.Empty;//代理商搜索条件 strwhere = Where(); if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = string.Format(@"select d.ID,o.ReceiptNo,b.DisName,b.DisCode,o.CreateDate, d.GoodsCode,d.GoodsName,d.GoodsNum,d.AuditAmount from DIS_OrderDetail d,DIS_Order o,BD_Distributor b where o.ID=d.OrderID and b.ID=d.DisID and ISNULL(o.dr,0)=0 and o.OState in(2,3,4,5,7) and o.Otype<>9 and o.CompID=" + this.CompID + " " + strwhere + " order by o.CreateDate desc"); Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string date = string.Empty; string strwhere = " "; if (SalesManID > 0 || OrgID > 0) { string whereIn = string.Empty; if (OrgID > 0) { whereIn += " and OrgID=" + OrgID + ""; } if (SalesManID > 0) { whereIn += " and SalesManID=" + SalesManID + ""; } strwhere = " and CompID in (select ID from [dbo].[BD_Company] where isnull(dr,0)=0 " + whereIn + ")"; } if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } //if (this.txtBCreateDate.Value.Trim() == "" && this.txtECreateDate.Value.Trim() == "") //{ // date = " and CreateDate>='" + DateTime.Now.AddDays(1 - DateTime.Now.Day).ToShortDateString() + " 0:0:0' "; //} string sql = "select CompID,goodsID,goodsCode,goodsName,categoryName,sum(goodsNum) goodsNum,sum(sumAmount) sumAmount from(" + "select * from [dbo].[GoodsSaleRpt_view] where OState in(2,4,5) " + date + strwhere + ")M " + "group by CompID,goodsID,goodsCode,goodsName,categoryName order by CompID"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["sumAmount"].ToString() == "" ? "0" : ds.Rows[i]["sumAmount"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); GetAllCompID(); this.Org.SelectedValue = this.OrgID == 0 ? Org.SelectedValue : this.OrgID.ToString(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = string.Empty; string IDlist = string.Empty;//销售经理下属 员工ID集合 if (DisSalesManID != 0) { if (Common.GetDisSalesManType(DisSalesManID.ToString(), out IDlist)) { //销售经理 strwhere = "and DisID in(select ID from BD_Distributor where smid in(" + IDlist + "))"; } else { strwhere = "and DisID in(select ID from BD_Distributor where smid = " + DisSalesManID + ")"; } } if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "" && this.txtPager.Value.Trim().ToString() != "0") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = string.Empty; if (paymentid > 0) { sql = "SELECT case sxf when '' then null else sxf end as sxf1,isnull(Price,0) as Price1,* FROM [dbo].[CompCollection_view] where pretype=" + pretype + " and paymentid=" + paymentid + " and status=1 order by Date desc"; } else { sql = "SELECT case sxf when '' then null else sxf end as sxf1,isnull(Price,0) as Price1,* FROM [dbo].[CompCollection_view] where OrderID in(select ID from Dis_Order where ISNULL(dr,0)=0 and (Otype<>9) and CompID=" + this.CompID + ") and status=1 and CompID=" + this.CompID + strwhere + " order by Date desc"; } Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 返回前台分页数据 /// </summary> /// <param name="pageIndex">页码</param> /// <param name="pageSize">页数据</param> /// <param name="sql">查询sql</param> /// <returns></returns> public DataTable GetDt(int pageIndex, int pageSize, string sql, string sql2) { Pagger pagger = new Pagger(sql); int count = pagger.GetDataCount(sql2); DataTable dt = pagger.getDataSql(pageSize, (pageIndex - 1) * pageSize); return(dt); }
/// <summary> /// 返回前台分页数据 /// </summary> /// <param name="pageIndex">页码</param> /// <param name="pageSize">页数据</param> /// <param name="sql">查询sql</param> /// <returns></returns> public string GetJson2(int pageIndex, int pageSize, string sql, string sql2) { Pagger pagger = new Pagger(sql); int count = pagger.GetDataCount(sql2); DataTable dt = pagger.getData(pageSize, (pageIndex - 1) * pageSize); return(CreateJson(count, pageSize, dt)); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = " and isnull(dr,0)=0"; if (SalesManID > 0 || OrgID > 0) { string whereIn = string.Empty; if (OrgID > 0) { whereIn += " and OrgID=" + OrgID + ""; } if (SalesManID > 0) { whereIn += " and SalesManID=" + SalesManID + ""; } strwhere = " and CompID in (select ID from [dbo].[BD_Company] where isnull(dr,0)=0 " + whereIn + ")"; } if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } //if (this.txtBCreateDate.Value.Trim() == "" && this.txtECreateDate.Value.Trim() == "") //{ // strwhere += " and CreateDate>='" + DateTime.Now.AddDays(1 - DateTime.Now.Day).ToShortDateString() + " 0:0:0' "; //} if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = "SELECT CompID,DisID,Sum([AuditAmount]) as [AuditAmount] ,Sum(PayedAmount) as PayedAmount FROM [dbo].[DIS_Order] " + "where isnull(dr,0)=0 and Otype!=9 and OState in(2,4,5) " + strwhere + " group by compid,disid order by compid,disid"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["AuditAmount"].ToString() == "" ? "0" : ds.Rows[i]["AuditAmount"].ToString()); tb += Convert.ToDecimal(ds.Rows[i]["PayedAmount"].ToString() == "" ? "0" : ds.Rows[i]["PayedAmount"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); this.Org.SelectedValue = this.OrgID == 0 ? Org.SelectedValue : this.OrgID.ToString(); }
/// <summary> /// 支付结果列表 /// </summary> /// <param name="pagger"></param> /// <param name="type"></param> /// <returns></returns> public ActionResult Index(Pagger pagger, int type = 0) { var model = new SearchResult(); var list = PayResultDAL.GetPayResultList(pagger, type); model.PaggerData = pagger; model.ResultData = list; ViewBag.SearchType = type; return(View(model)); }
/// <summary> /// 执行SQL语句查询数据 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="page">分页信息</param> /// <param name="sql">被执行的SQL语句</param> /// <param name="param">参数列表</param> /// <param name="commandTimeout">超时时间(单位:秒)</param> /// <param name="connectionName">数据库连接</param> /// <param name="rowIndexName">序号列名称</param> /// <returns></returns> public static List <T> GetData <T>(Pagger page, string sql, object param = null, int?commandTimeout = null, string connectionName = null, string rowIndexName = "RowIndex") { sql = string.Format("SELECT * FROM ( {0} ) AS ResultDT", sql); if (page != null && !page.GetTotal) { sql += string.Format(" WHERE ResultDT.{0} BETWEEN {1} AND {2} ", rowIndexName, page.BeginIndex, page.EndIndex); } return(DbHelper.Query <T>(sql, param, commandTimeout, connectionName: connectionName)); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = string.Empty; //代理商、商品搜索条件 string strwhere2 = string.Empty; //日期搜索条件 if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (ViewState["strwhere2"] != null) { strwhere2 += ViewState["strwhere2"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = string.Format(@"select od.GoodsinfoID,od.GoodsName,od.GoodsInfos,od.GoodsCode,gg.TypeName,od.OrderID,o.CompID,o.DisID,HtID,HospitalName HtName,sum(od.GoodsNum) GoodsNum,sum(od.GoodsPrice) GoodsPrice from DIS_OrderDetail od left join DIS_Order o on od.OrderID=o.ID left join BD_GoodsInfo info on info.ID=od.GoodsinfoID left join BD_Goods g on info.GoodsID=g.ID left join SYS_GType gg on g.CategoryID=gg.ID left join (select GoodsID,HtID,ht.HospitalName from YZT_FirstCamp fc left join YZT_CMerchants cm on cm.ID=fc.CMID left join SYS_Hospital ht on ht.ID=fc.HtID where fc.State=2 and fc.dr=0 and cm.dr=0 and cm.IsEnabled=1) CMFC on od.GoodsinfoID=CMFC.GoodsID where o.OState in(2,4,5) {0} {1} {2} group by od.GoodsinfoID,od.GoodsName,od.GoodsInfos,od.GoodsCode,gg.TypeName,HtID,HospitalName,od.OrderID,o.CompID,o.DisID order by od.GoodsinfoID ", " and o.CompID=" + this.CompID, strwhere, strwhere2); Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { td += Convert.ToDecimal(ds.Rows[i]["GoodsNum"].ToString() == "" ? "0" : ds.Rows[i]["GoodsNum"].ToString()); te += Convert.ToDecimal(ds.Rows[i]["GoodsPrice"].ToString() == "" ? "0" : ds.Rows[i]["GoodsPrice"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = string.Empty; string IDlist = string.Empty;//销售经理下属 员工ID集合 if (DisSalesManID != 0) { if (Common.GetDisSalesManType(DisSalesManID.ToString(), out IDlist)) { //销售经理 strwhere = "and DisID in(select ID from BD_Distributor where smid in(" + IDlist + "))"; } else { strwhere = "and DisID in(select ID from BD_Distributor where smid = " + DisSalesManID + ")"; } } if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = "SELECT * FROM [dbo].[CompCollection_view] " + " where OrderID in(select ID from Dis_Order where ISNULL(dr,0)=0 and Otype=9 and CompID=" + this.CompID + ") and CompID=" + this.CompID + strwhere + " order by Date desc"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["Price"].ToString() == "" ? "0" : ds.Rows[i]["Price"].ToString()) - Convert.ToDecimal(ds.Rows[i]["sxf"].ToString() == "" ? "0" : ds.Rows[i]["sxf"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = @"select bd_distributor.DisName '付款方', PAY_Payment.PayPrice '付款金额' ,PAY_Payment.guid '交易流水号', dis_order.ReceiptNo '订单编号', case when Channel=1 then '快捷支付' when Channel=2 then '银联支付' when Channel=3 then '网银支付' when Channel=4 then 'B2B网银支付' end as '付款方式',PayDate '支付时间', AccountName '收款方',bankcode '收款方帐号',PAY_PayLog.CreateDate '清算时间' ,case when PAY_PayLog.MarkName='40' then '成功' when PAY_PayLog.MarkName='50' then '回冲' when PAY_PayLog.MarkName='9999' then '已处理' else '失败' end as '清算状态' from PAY_Payment join BD_Distributor on bd_distributor.id=pay_payment.disid join dis_order on dis_order.id=pay_payment.orderid join PAY_PayLog on PAY_PayLog.number=pay_payment.guid and Start=2000 where PAY_Payment.isaudit=1" + strwhere + " order by PayDate desc"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["付款金额"].ToString() == "" ? "0" : ds.Rows[i]["付款金额"].ToString()); //tb += Convert.ToDecimal(((Convert.ToDecimal(ds.Rows[i]["AuditAmount"].ToString() == "" ? "0" : ds.Rows[i]["AuditAmount"].ToString()) - Convert.ToDecimal(new Hi.BLL.PAY_PrePayment().sums(ds.Rows[i]["DisID"].ToString().ToInt(0), Convert.ToInt32(ds.Rows[i]["CompID"].ToString())))) > 0 ? (Convert.ToDecimal(ds.Rows[i]["AuditAmount"].ToString() == "" ? "0" : ds.Rows[i]["AuditAmount"].ToString()) - Convert.ToDecimal(new Hi.BLL.PAY_PrePayment().sums(ds.Rows[i]["DisID"].ToString().ToInt(0), Convert.ToInt32(ds.Rows[i]["CompID"].ToString())))).ToString() : "0").ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); // this.Org.SelectedValue = this.OrgID == 0 ? Org.SelectedValue : this.OrgID.ToString(); }
public static Pagger <dynamic> Get <T>(Page page, IEnumerable <T> source) { var response = new Pagger <dynamic>(); List <dynamic> data = SetOrdered <T>(page, (IEnumerable <dynamic>)source).ToList(); response.Data = data.Skip((page.PageNumber - 1) * page.PageSize).Take(page.PageSize).ToList(); response.PageNumber = page.PageNumber; response.PageSize = page.PageSize; response.Total = data.Count; return(response); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string date = string.Empty; string strwhere = string.Empty; if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } if (this.txtBCreateDate.Value.Trim() == "" && this.txtECreateDate.Value.Trim() == "") { this.txtBCreateDate.Value = Convert.ToDateTime(DateTime.Now.Date.ToString().Substring(0, 4) + "/1/1").ToString("yyyy-MM-dd"); this.txtECreateDate.Value = DateTime.Now.ToString("yyyy-MM-dd"); date = " and CreateDate>='" + DateTime.Now.Date.ToString().Substring(0, 4) + "/1/1 0:0:0' "; } if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } string sql = "select CompID,DisID,YEAR([CreateDate]) Years,MONTH([CreateDate]) as Months,SUM([sumAmount]) as [TotalAmount],sum( CASE WHEN Otype=9 THEN AuditAmount ELSE 0 END) as [zdAmount] " + " from ( SELECT * FROM [dbo].[MonthSaleRpt_view] where compID=" + this.CompID + date + strwhere + ")M " + "where compID=" + this.CompID + " group by YEAR([CreateDate]), MONTH([CreateDate]),CompID,disID order by DisID,YEAR([CreateDate]),MONTH([CreateDate])"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["TotalAmount"].ToString() == "" ? "0" : ds.Rows[i]["TotalAmount"].ToString()); tb += Convert.ToDecimal(ds.Rows[i]["zdAmount"].ToString() == "" ? "0" : ds.Rows[i]["zdAmount"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
public async Task <IActionResult> GetUsers([FromQuery] PageParameters pageParameters, string searchString) { if (searchString == null) { searchString = ""; } var users = await _repo.GetSearchedAndSortedUsers(pageParameters, searchString); Pagger <UsersDisplayDto> usersToReturn = new Pagger <UsersDisplayDto>(users); return(Ok(usersToReturn)); }
/// <summary> /// 商品列表绑定 /// </summary> public void Bind() { string strWhere = "and ISNULL(dr,0)=0 and ComPid=" + this.CompID; if (ViewState["strWhere"] != null) { strWhere += ViewState["strWhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length < 4) { Pagers.PageSize = int.Parse(this.txtPager.Value.Trim()); } else { this.txtPager.Value = "100"; this.Pagers.PageSize = 100; } } //根据代理商ID获取可采购的商品ID集合 List <Common.GoodsID> gl = Common.DisEnAreaGoodsID(this.DisID.ToString(), this.CompID.ToString()); string GoodsId = string.Empty; if (gl != null && gl.Count > 0) { foreach (Common.GoodsID item in gl) { GoodsId += item.goodsID + ","; } strWhere += " and ID not in(" + GoodsId.Substring(0, GoodsId.Length - 1) + ")"; } //List<Hi.Model.BD_Goods> l = new Hi.BLL.BD_Goods().GetList(Pagers.PageSize, Pagers.CurrentPageIndex, "id", true, strWhere, out pageCount, out Counts); //goodsCategory = new Hi.BLL.BD_GoodsCategory().GetList("", " ISNULL(dr,0)=0 and ComPid=" + user.CompID, ""); string sql = string.Format(@"select *,(select Inventory from BD_GoodsInfo where ID=g.ViewInfoID) infoInve,(select BarCode from BD_GoodsInfo where ID=g.ViewInfoID) BarCode from BD_Goods as g left join (select prod.GoodsID as proGoodsID from BD_Promotion as pro left join BD_PromotionDetail as prod on pro.ID=prod.ProID where pro.CompID={0} and ISNULL(pro.dr,0)=0 and (pro.ProStartTime<=GETDATE() and DATEADD(D,1,pro.ProEndTime)>GETDATE()) and ISNULL(pro.IsEnabled,0)=1 group by prod.GoodsID) as b on b.proGoodsID=g.ID where 1=1 {1} and CompID= {0} and isnull(IsEnabled,0)=1 and IsOffline=1 and isnull(dr,0)=0 order by b.proGoodsID desc,g.CreateDate desc", this.CompID, strWhere); Pagger pagger = new Pagger(sql); Pagers.RecordCount = pagger.getDataCount(); DataTable dt = pagger.getData(Pagers.PageSize, Pagers.StartRecordIndex - 1); this.rptProList.DataSource = dt; this.rptProList.DataBind(); }
public void Bind() { string goodsids = new Hi.BLL.BD_DisCollect().GetGoodsIDs(this.DisID); if (string.IsNullOrEmpty(goodsids)) { goodsids = "0"; } string strwhere = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } strwhere += " and isnull(dr,0)=0 and id in (" + goodsids + ") and IsEnabled=1 and ISOffline=1"; Pager.PageSize = 12; //根据代理商ID获取可采购的商品ID集合 List <Common.GoodsID> gl = Common.DisEnAreaGoodsID(this.DisID.ToString(), CompID.ToString()); string GoodsId = string.Empty; if (gl != null && gl.Count > 0) { foreach (Common.GoodsID item in gl) { GoodsId += item.goodsID + ","; } strwhere += " and ID not in(" + GoodsId.Substring(0, GoodsId.Length - 1) + ")"; } else { //strwhere += " and ID=0"; } //List<Hi.Model.BD_Goods> orders = new Hi.BLL.BD_Goods().GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", true, strwhere, out pageCount, out Counts); string sql = string.Format(@"select *,(select Inventory from BD_GoodsInfo where ID=g.ViewInfoID) infoInve,(select BarCode from BD_GoodsInfo where ID=g.ViewInfoID) BarCode from BD_Goods as g left join (select prod.GoodsID as proGoodsID from BD_Promotion as pro left join BD_PromotionDetail as prod on pro.ID=prod.ProID where pro.CompID={0} and ISNULL(pro.dr,0)=0 and (pro.ProStartTime<=GETDATE() and DATEADD(D,1,pro.ProEndTime)>GETDATE()) and ISNULL(pro.IsEnabled,0)=1 group by prod.GoodsID) as b on b.proGoodsID=g.ID where 1=1 {1} and CompID= {0} and isnull(IsEnabled,0)=1 and IsOffline=1 and isnull(dr,0)=0 order by b.proGoodsID desc,g.CreateDate desc", this.CompID, strwhere); Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.getDataCount(); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); this.rptfavorite.DataSource = dt; this.rptfavorite.DataBind(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string date = string.Empty; string strwhere = string.Empty; string sqldate = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = string.Format(@"select l.hospital,sum(ld.sumAmount) sumAmount,sum(p.sumAmount) PaymentAmount ,(isnull(sum(ld.sumAmount),0)-isnull(sum(p.sumAmount),0)) Amount,l.MoneyDate from YZT_LibraryDetail ld left join YZT_Library l on ld.LibraryID=l.ID left join (select Sum(sumAmount) sumAmount,p.hospital,p.DisID,pd.LibraryID from YZT_Payment p left join YZT_PaymentDetail pd on pd.PaymentID=p.ID where ISNULL(pd.dr,0)=0 and ISNULL(p.dr,0)=0 and ISNULL(p.IState,0)=1 group by p.hospital,p.DisID,pd.LibraryID) p on p.hospital=l.hospital and ld.ID=p.LibraryID where l.DisID={0} {1} group by l.hospital,l.MoneyDate order by l.hospital", this.DisID, strwhere); Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["Amount"].ToString() == "" ? "0" : ds.Rows[i]["Amount"].ToString()); tb += Convert.ToDecimal(ds.Rows[i]["sumAmount"].ToString() == "" ? "0" : ds.Rows[i]["sumAmount"].ToString()); tc += Convert.ToDecimal(ds.Rows[i]["PaymentAmount"].ToString() == "" ? "0" : ds.Rows[i]["PaymentAmount"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = string.Empty; //代理商搜索条件 string strwhere2 = string.Empty; //日期搜索条件 if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (ViewState["strwhere2"] != null) { strwhere2 += ViewState["strwhere2"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = string.Format(@"select cd.ID,cd.ContID,cd.GoodsID,cd.GoodsName,cd.GoodsCode,cd.ValueInfo,cd.HtID,ht.HospitalName, cd.SalePrice,cd.discount,cd.TinkerPrice,cd.target,c.DisID,dis.DisName,(select sum(sumAmount) from DIS_OrderDetail od left join DIS_Order o on od.OrderID=o.ID where o.OState in(2,4,5) and o.dr=0 and o.DisID=c.DisID and o.CompID=c.CompID and od.GoodsinfoID=cd.GoodsID) sumAmount from YZT_ContractDetail cd join YZT_Contract c on cd.ContID=c.ID and c.CState<>2 left join SYS_Hospital ht on cd.HtID=ht.ID left join BD_Distributor dis on dis.ID=c.DisID where c.CompID={0} {1} order by c.CreateDate", this.CompID, strwhere2); Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 绑定 /// </summary> public void Bind() { if (this.txtPager.Value.Trim().ToString() != "" && this.txtPager.Value.Trim().ToString() != "0") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 10; this.txtPager.Value = "10"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string strWhere = string.Format("and a.compid={0} and b.compid={0}", this.CompID); if (ViewState["strWhere"] != null) { strWhere += ViewState["strWhere"].ToString(); } //已选中的商品不查询出来 object obj = Session["GoodsPrice"]; if (obj != null) { List <int> l = new List <int>(); List <Hi.Model.BD_GoodsInfo> lll = obj as List <Hi.Model.BD_GoodsInfo>; foreach (var item in lll) { l.Add(item.ID); } strWhere += "and a.id not in (" + string.Join(",", l) + ")"; } Pagger pagger = new Pagger(Returnsql(strWhere.ToString())); Pager.RecordCount = pagger.getDataCount(); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); this.rptGoodsInfo.DataSource = dt; this.rptGoodsInfo.DataBind(); //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$(function(){ $(\"#CB_SelAll\").trigger(\"click\");})</script>"); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = "select compID,DisID,sum(AuditAmount-PayedAmount) AuditAmount,sum( CASE WHEN DiffYear='1' THEN AuditAmount-PayedAmount ELSE 0 END) year1," + "sum( CASE WHEN DiffYear=2 THEN AuditAmount-PayedAmount ELSE 0 END) year2,sum( CASE WHEN DiffYear<>2 and DiffYear<>1 THEN AuditAmount-PayedAmount ELSE 0 END) year3 ,DisAccount from(" + "select * from [dbo].[ArrearageRpt_view] where " + " CompID=" + this.CompID + " and Otype!=9 " + strwhere + ")M " + " where compID=" + this.CompID + " group by compID,DisID,DisAccount order by compID,DisID"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["AuditAmount"].ToString() == "" ? "0" : ds.Rows[i]["AuditAmount"].ToString()); tb += Convert.ToDecimal(((Convert.ToDecimal(ds.Rows[i]["AuditAmount"].ToString() == "" ? "0" : ds.Rows[i]["AuditAmount"].ToString()) - Convert.ToDecimal(new Hi.BLL.PAY_PrePayment().sums(ds.Rows[i]["DisID"].ToString().ToInt(0), CompID))) > 0 ? (Convert.ToDecimal(ds.Rows[i]["AuditAmount"].ToString() == "" ? "0" : ds.Rows[i]["AuditAmount"].ToString()) - Convert.ToDecimal(new Hi.BLL.PAY_PrePayment().sums(ds.Rows[i]["DisID"].ToString().ToInt(0), CompID))).ToString() : "0").ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 代理商列表显示 /// </summary> public void Bind() { string strwhere = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } //if (this.txtArriveDate.Value.Trim() == "" && this.txtArriveDate1.Value.Trim() == "") //{ // strwhere += " and Date>='" + DateTime.Now.AddDays(1 - DateTime.Now.Day).ToShortDateString() + " 0:0:0' "; //} string sql = "SELECT * FROM [dbo].[CompCollection_view] " + " where OrderID not in(select ID from Dis_Order where ISNULL(dr,0)=0 and Otype=9 and DisID=" + this.DisID + ") and DisID=" + this.DisID + " and CompID=" + this.ddrComp.Value + strwhere + " order by Date desc"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["Price"].ToString() == "" ? "0" : ds.Rows[i]["Price"].ToString()); sxf += Convert.ToDecimal(ds.Rows[i]["sxf"].ToString() == "" ? "0" : ds.Rows[i]["sxf"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string date = string.Empty; string strwhere = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = "select compID,DisID,goodsCode,goodsName,categoryName,sum(goodsNum) goodsNum,sum(sumAmount) sumAmount from(" + "select *from [dbo].[GoodsSaleRpt_view] where " + " CompID=" + this.CompID + strwhere + date + ")M " + " where compID=" + this.CompID + " group by compID,DisID,goodsCode,goodsName,categoryName order by compID"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["sumAmount"].ToString() == "" ? "0" : ds.Rows[i]["sumAmount"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 分页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void GetAllCompID() { string Hcomp = string.Empty; string sql = "select CompID,goodsID,goodsCode,goodsName,categoryName,sum(goodsNum) goodsNum,sum(sumAmount) sumAmount from(" + "select * from [dbo].[GoodsSaleRpt_view] where 1=1 )M " + " group by CompID,goodsID,goodsCode,goodsName,categoryName order by goodsCode,goodsName,categoryName"; Pagger pagger = new Pagger(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { Hcomp += dt.Rows[i]["CompID"].ToString() + ","; } this.hidCompId.Value = Hcomp.Substring(0, Hcomp.Length - 1); } }
/// <summary> /// 商品列表绑定 /// </summary> public void Bind() { int pageCount = 0; int Counts = 0; string strWhere = " and a.compId=" + this.CompID + " and b.ComPid=" + this.CompID; if (ViewState["strWhere"] != null) { strWhere += ViewState["strWhere"].ToString(); } else { if (this.ddlState.SelectedValue != "") { strWhere += " and isNUll(a.IsOffLine,0)=" + this.ddlState.SelectedValue; } } //每页显示的数据设置 if (this.txtPageSize.Value.ToString() != "") { if (this.txtPageSize.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPageSize.Value = "100"; } else { Pager.PageSize = this.txtPageSize.Value.Trim().ToInt(0); } } //List<Hi.Model.BD_GoodsInfo> l = new Hi.BLL.BD_GoodsInfo().GetList(Pager.PageSize, Pager.CurrentPageIndex, "id", true, strWhere, out pageCount, out Counts); //this.rptGoodsInfo.DataSource = l; //this.rptGoodsInfo.DataBind(); //Pager.RecordCount = Counts; //page = Pager.CurrentPageIndex.ToString(); Pagger pagger = new Pagger(Returnsql(strWhere.ToString())); Pager.RecordCount = pagger.getDataCount(); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); this.rptGoodsInfo.DataSource = dt; this.rptGoodsInfo.DataBind(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string strwhere = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = "SELECT DisID,Sum([AuditAmount]) as [AuditAmount] ,Sum(PayedAmount) as PayedAmount FROM [dbo].[DIS_Order] " + "where isnull(dr,0)=0 and Otype<>9 and compID=" + this.CompID + strwhere + " group by disid order by disid"; Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["AuditAmount"].ToString() == "" ? "0" : ds.Rows[i]["AuditAmount"].ToString()); tb += Convert.ToDecimal(ds.Rows[i]["PayedAmount"].ToString() == "" ? "0" : ds.Rows[i]["PayedAmount"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); //Pager.RecordCount = Counts; page = Pager.CurrentPageIndex.ToString(); }
/// <summary> /// 绑定数据 /// </summary> public void Bind() { string date = string.Empty; string strwhere = string.Empty; string sqldate = string.Empty; if (ViewState["strwhere"] != null) { strwhere += ViewState["strwhere"].ToString(); } if (this.txtPager.Value.Trim().ToString() != "") { if (this.txtPager.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPager.Value = "100"; } else { Pager.PageSize = this.txtPager.Value.Trim().ToInt(0); } } string sql = string.Format(@"select ld.GoodsName,ld.ValueInfo,l.hospital,isnull(l.PaymentDays,0) PaymentDays,sum(ld.OutNum) OutNUm,sum(ld.sumAmount) sumAmount from YZT_LibraryDetail ld left join YZT_Library l on ld.LibraryID=l.ID where ISNULL(l.dr,0)=0 and l.IState=1 and ld.DisID={0} and ISNULL(ld.dr,0)=0 {1} group by ld.GoodsName,l.hospital,ld.ValueInfo,l.PaymentDays order by ld.GoodsName", this.DisID, strwhere); Pagger pagger = new Pagger(sql); Pager.RecordCount = pagger.GetDataCount(sql); DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1); DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; for (int i = 0; i < ds.Rows.Count; i++) { ta += Convert.ToDecimal(ds.Rows[i]["sumAmount"].ToString() == "" ? "0" : ds.Rows[i]["sumAmount"].ToString()); } this.rptOrder.DataSource = dt; this.rptOrder.DataBind(); page = Pager.CurrentPageIndex.ToString(); }