public override void DataBind() { this.Items.Clear(); base.Items.Add(new ListItem(string.Empty, string.Empty)); foreach (Distributor distributor in DistributorHelper.GetDistributors()) { base.Items.Add(new ListItem(distributor.Username, distributor.UserId.ToString())); } }
public override void DataBind() { this.Items.Clear(); base.Items.Add(new ListItem(this.NullToDisplay, string.Empty)); IList <Hidistro.Membership.Context.Distributor> distributors = DistributorHelper.GetDistributors(); foreach (Hidistro.Membership.Context.Distributor current in distributors) { base.Items.Add(new ListItem(current.Username, current.UserId.ToString())); } }
private void BindDistributorRequest() { DistributorQuery query = new DistributorQuery(); query.IsApproved = false; query.PageIndex = this.pager.PageIndex; query.PageSize = this.pager.PageSize; query.Username = this.Keywords; query.RealName = this.RealName; query.SortBy = "CreateDate"; query.SortOrder = SortAction.Desc; DbQueryResult distributors = DistributorHelper.GetDistributors(query); this.grdDistributorRequests.DataSource = distributors.Data; this.grdDistributorRequests.DataBind(); this.pager.TotalRecords = distributors.TotalRecords; this.pager1.TotalRecords = distributors.TotalRecords; }
private void BindDistributorRequest() { DbQueryResult distributors = DistributorHelper.GetDistributors(new DistributorQuery { IsApproved = false, PageIndex = this.pager.PageIndex, PageSize = this.pager.PageSize, Username = this.Keywords, RealName = this.RealName, SortBy = "CreateDate", SortOrder = SortAction.Desc }); this.grdDistributorRequests.DataSource = distributors.Data; this.grdDistributorRequests.DataBind(); this.pager.TotalRecords = distributors.TotalRecords; this.pager1.TotalRecords = distributors.TotalRecords; }
private void BindDistributors() { DistributorQuery query = new DistributorQuery(); query.IsApproved = true; query.PageIndex = pager.PageIndex; query.PageSize = pager.PageSize; query.GradeId = gradeId; query.LineId = lineId; query.Username = userName; query.RealName = realName; query.SortBy = grdDistributorList.SortOrderBy; if (grdDistributorList.SortOrder.ToLower() == "desc") { query.SortOrder = SortAction.Desc; } DbQueryResult distributors = DistributorHelper.GetDistributors(query); grdDistributorList.DataSource = distributors.Data; grdDistributorList.DataBind(); pager.TotalRecords = distributors.TotalRecords; pager1.TotalRecords = distributors.TotalRecords; }
private void BindDistributors() { DistributorQuery distributorQuery = new DistributorQuery(); distributorQuery.IsApproved = true; distributorQuery.PageIndex = this.pager.PageIndex; distributorQuery.PageSize = this.pager.PageSize; distributorQuery.GradeId = this.gradeId; distributorQuery.LineId = this.lineId; distributorQuery.Username = this.userName; distributorQuery.RealName = this.realName; distributorQuery.SortBy = this.grdDistributorList.SortOrderBy; if (this.grdDistributorList.SortOrder.ToLower() == "desc") { distributorQuery.SortOrder = SortAction.Desc; } DbQueryResult distributors = DistributorHelper.GetDistributors(distributorQuery); this.grdDistributorList.DataSource = distributors.Data; this.grdDistributorList.DataBind(); this.pager.TotalRecords = distributors.TotalRecords; this.pager1.TotalRecords = distributors.TotalRecords; }
public void ProcessRequest(HttpContext context) { string str = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; string str2 = ""; string str3 = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; string str4 = ""; string s = ""; SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); new StringBuilder(); str2 = context.Request.QueryString["action"].ToString(); string sign = context.Request.Form["sign"]; string str7 = context.Request.Form["format"]; string checkCode = masterSettings.CheckCode; XmlDocument node = new XmlDocument(); new Dictionary <string, string>(); SortedDictionary <string, string> tmpParas = new SortedDictionary <string, string>(); try { string str11; if (((str11 = str2) != null) && (str11 == "distribution_list")) { string str9 = context.Request.Form["parma"].Trim(); str4 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "parma"); if (!string.IsNullOrEmpty(str9)) { str4 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign"); DistributorQuery query = new DistributorQuery(); query = (DistributorQuery)JavaScriptConvert.DeserializeObject(str9, typeof(DistributorQuery)); tmpParas = this.GetDistriubots(query); tmpParas.Add("action", "distribution_list"); tmpParas.Add("format", str7); if (APIHelper.CheckSign(tmpParas, checkCode, sign)) { DbQueryResult distributors = DistributorHelper.GetDistributors(query); string format = str + "<response_distributors>{0}<totalcount>{1}</totalcount></response_distributors>"; if (distributors.Data != null) { s = string.Format(format, this.ConvertTableToXml((DataTable)distributors.Data), distributors.TotalRecords.ToString()); } else { s = string.Format(format, "", "0"); } } } } } catch (Exception exception) { str4 = MessageInfo.ShowMessageInfo(ApiErrorCode.Unknown_Error, exception.Message); } if (s == "") { s = s + str3 + str4; } context.Response.ContentType = "text/xml"; if (str7 == "json") { s = s.Replace("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>", ""); node.Load(new MemoryStream(Encoding.GetEncoding("UTF-8").GetBytes(s))); s = JavaScriptConvert.SerializeXmlNode(node); context.Response.ContentType = "text/json"; } context.Response.Write(s); }
public void ProcessRequest(System.Web.HttpContext context) { string str = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; string str2 = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; string str3 = ""; string text = ""; Hidistro.Membership.Context.SiteSettings masterSettings = Hidistro.Membership.Context.SettingsManager.GetMasterSettings(false); new System.Text.StringBuilder(); string text2 = context.Request.QueryString["action"].ToString(); string sign = context.Request.Form["sign"]; string text3 = context.Request.Form["format"]; string checkCode = masterSettings.CheckCode; System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument(); new System.Collections.Generic.Dictionary <string, string>(); System.Collections.Generic.SortedDictionary <string, string> sortedDictionary = new System.Collections.Generic.SortedDictionary <string, string>(); try { string a; if ((a = text2) != null && a == "distribution_list") { string text4 = context.Request.Form["parma"].Trim(); str3 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "parma"); if (!string.IsNullOrEmpty(text4)) { str3 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign"); DistributorQuery query = new DistributorQuery(); query = (DistributorQuery)JavaScriptConvert.DeserializeObject(text4, typeof(DistributorQuery)); sortedDictionary = this.GetDistriubots(query); sortedDictionary.Add("action", "distribution_list"); sortedDictionary.Add("format", text3); if (APIHelper.CheckSign(sortedDictionary, checkCode, sign)) { DbQueryResult distributors = DistributorHelper.GetDistributors(query); string format = str + "<response_distributors>{0}<totalcount>{1}</totalcount></response_distributors>"; if (distributors.Data != null) { text = string.Format(format, this.ConvertTableToXml((System.Data.DataTable)distributors.Data), distributors.TotalRecords.ToString()); } else { text = string.Format(format, "", "0"); } } } } } catch (System.Exception ex) { str3 = MessageInfo.ShowMessageInfo(ApiErrorCode.Unknown_Error, ex.Message); } if (text == "") { text = text + str2 + str3; } context.Response.ContentType = "text/xml"; if (text3 == "json") { text = text.Replace("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>", ""); xmlDocument.Load(new System.IO.MemoryStream(System.Text.Encoding.GetEncoding("UTF-8").GetBytes(text))); text = JavaScriptConvert.SerializeXmlNode(xmlDocument); context.Response.ContentType = "text/json"; } context.Response.Write(text); }