private void BindData() { int userId = Hidistro.Membership.Context.HiContext.Current.User.UserId; Supplier_QueryInfo managerQuery = this.GetManagerQuery(); DbQueryResult dbQueryResult = Methods.Supplier_S_StockInfoGet(managerQuery, null, new int?(userId)); this.grdManager.DataSource = dbQueryResult.Data; this.grdManager.DataBind(); this.txtStockCode.Text = managerQuery.Code; this.pager.TotalRecords = dbQueryResult.TotalRecords; this.pager1.TotalRecords = dbQueryResult.TotalRecords; }
private Supplier_QueryInfo GetManagerQuery() { Supplier_QueryInfo supplier_QueryInfo = new Supplier_QueryInfo(); if (!string.IsNullOrEmpty(this.Page.Request.QueryString["DateDay"])) { supplier_QueryInfo.DateDay = this.Page.Request.QueryString["DateDay"]; } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["StartDate"])) { supplier_QueryInfo.StartDate = new System.DateTime?(System.DateTime.Parse(this.Page.Request.QueryString["StartDate"])); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["EndDate"])) { supplier_QueryInfo.EndDate = new System.DateTime?(System.DateTime.Parse(this.Page.Request.QueryString["EndDate"])); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["Code"])) { supplier_QueryInfo.Code = Globals.UrlDecode(this.Page.Request.QueryString["Code"]); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["Status"])) { supplier_QueryInfo.Status = this.Page.Request.QueryString["Status"]; } supplier_QueryInfo.PageSize = this.pager.PageSize; supplier_QueryInfo.PageIndex = this.pager.PageIndex; if (!string.IsNullOrEmpty(this.Page.Request.QueryString["SortBy"])) { supplier_QueryInfo.SortBy = this.Page.Request.QueryString["SortBy"]; } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["SortOrder"])) { supplier_QueryInfo.SortOrder = SortAction.Desc; } return(supplier_QueryInfo); }