public void UserDataBind() { int pageCount = 0; int Counts = 0; List <Hi.Model.SYS_CompUser> ListComp = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and DisID=" + KeyID + " and CompID=" + this.CompID, ""); if (ListComp.Count > 0) { lblTyoeName.Value = Common.GetDisTypeNameById(ListComp[0].DisTypeID); lblAreaName.Value = Common.GetDisAreaNameById(ListComp[0].AreaID); lblIsEnabled.InnerHtml = ListComp[0].IsEnabled == 1 ? "启用" : "<i style='color:red;'>禁用</i>"; rdAuditYes.InnerHtml = ListComp[0].IsCheck == 1 ? "是" : "<i style='color:red;'>否</i>"; rdCreditYes.InnerHtml = ListComp[0].CreditType == 0 ? "<i style='color:red;'>否</i>" : "是"; lblCreditAmount.Value = ListComp[0].CreditAmount.ToString("0.00") == "0.00" ? "没有限额" : ListComp[0].CreditAmount.ToString("0.00"); if (ListComp[0].CreditType == 0) { this.spanCreditAmount.Style.Add("display", "none"); this.lblCreditAmount.Style.Add("display", "none"); } if (ListComp[0].IsAudit == 2) { if (ListComp[0].IsEnabled == 1) { libtnNUse.Visible = true; libtnUse.Visible = false; } else { libtnUse.Visible = true; libtnNUse.Visible = false; } libtnAudit.Visible = false; libtnDel.Visible = false; } else { libtnEdit.Visible = false; libtnUse.Visible = false; libtnNUse.Visible = false; } //禁用状态,可以删除 if (ListComp[0].IsEnabled == 0) { libtnDel.Visible = true; } string users = string.Join(",", ListComp.Select(t => t.UserID)); List <Hi.Model.SYS_Users> LDis = new Hi.BLL.SYS_Users().GetList(Pager.PageSize, Pager.CurrentPageIndex, "Createdate", false, " and isnull(dr,0)=0 and id in(" + users + ") ", out pageCount, out Counts); this.Rpt_User.DataSource = LDis; this.Rpt_User.DataBind(); Pager.RecordCount = Counts; page = Pager.CurrentPageIndex.ToString(); } else { if (Request.UrlReferrer != null) { JScript.AlertMethod(this, "用户数据有误", JScript.IconOption.错误, "function (){ history.go(-1); }"); return; } else { Response.Write("用户数据有误!"); Response.End(); } } }
public void LoginHTML(string Userid, int type) { if (!string.IsNullOrWhiteSpace(Userid)) { WriteHTML = " <div class=\"pageLogin\" id=\"AccountSwitch\" > <div class=\"role-cur\"> "; List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("id,compid,Disid,Ctype,Utype", " isnull(dr,0)=0 and IsAudit=2 and IsEnabled=1 and userid in(" + Userid + ")", ""); if (ListCompUser.Count > 0) { string Compid = string.Join(",", ListCompUser.Where(T => T.CType == 1 && (T.UType == 3 || T.UType == 4)).ToList().Select(T => T.CompID)); if (Compid != "") { List <Hi.Model.BD_Company> ListComp = new Hi.BLL.BD_Company().GetList("ID,CompName", " isnull(dr,0)=0 and AuditState=2 and IsEnabled=1 and ID in(" + Compid + ")", "createdate"); if (ListComp.Count > 0) { WriteHTML += (ListComp.Count > 0 ? "<div class=\"title\"><i class=\"hx-i\"></i>厂商</div> <div class=\"list\">" : ""); string CompHTML = ""; foreach (Hi.Model.BD_Company model in ListComp) { CompHTML += "<a href=\"javascript:;\" type=" + type + " title='" + model.CompName + "' tip='" + Common.DesEncrypt(ListCompUser.Where(T => T.CType == 1 && T.CompID == model.ID).ToList()[0].ID.ToString(), Common.EncryptKey) + "'>" + model.CompName + "</a>"; } WriteHTML += CompHTML; WriteHTML += (ListComp.Count > 0 ? "</div>" : ""); } } ListCompUser = ListCompUser.Where(T => T.CType == 2 && (T.UType == 1 || T.UType == 5)).ToList(); string DisID = string.Join(",", ListCompUser.Select(T => T.DisID)); Compid = string.Join(",", ListCompUser.ToList().Select(T => T.CompID)); if (DisID != "" && Compid != "") { List <Hi.Model.BD_Distributor> ListDis = new Hi.BLL.BD_Distributor().GetList("ID,DisName,CompID", " isnull(dr,0)=0 and AuditState=2 and IsEnabled=1 and ID in(" + DisID + ")", "createdate"); List <Hi.Model.BD_Company> ListComp = new Hi.BLL.BD_Company().GetList("ID,CompName", " isnull(dr,0)=0 and ID in(" + Compid + ")", "createdate"); if (ListDis.Count > 0 && ListComp.Count > 0) { WriteHTML += (ListDis.Count > 0 ? "<div class=\"title\"><i class=\"jx-i\"></i>代理商</div> <div class=\"list\">" : ""); string CompHTML = ""; foreach (Hi.Model.BD_Distributor model in ListDis) { string Name = ""; if (ListComp.Where(T => T.ID == model.CompID).ToList().Count > 0) { Name = ListComp.Where(T => T.ID == model.CompID).ToList()[0].CompName; } CompHTML += "<a href=\"javascript:;\" title='" + (Name) + "' type=" + type + " tip='" + Common.DesEncrypt(ListCompUser.Where(T => T.CType == 2 && T.DisID == model.ID).ToList()[0].ID.ToString(), Common.EncryptKey) + "'>" + (Name) + "</a>"; } WriteHTML += CompHTML; WriteHTML += (ListDis.Count > 0 ? "</div>" : ""); } } //Compid = string.Join(",", ListCompUser.Where(T => T.CType == 2 && (T.UType == 1 || T.UType == 5)).ToList().Select(T => T.CompID)); //if (Compid != "") //{ // List<Hi.Model.BD_Company> ListComp = new Hi.BLL.BD_Company().GetList("ID,CompName", " isnull(dr,0)=0 and AuditState=2 and IsEnabled=1 and ID in(" + Compid + ")", "createdate"); // WriteHTML += (ListComp.Count > 0 ? "<div class=\"title\"><i class=\"hx-i\"></i>代理商</div> <div class=\"list\">" : ""); // string CompHTML = ""; // foreach (Hi.Model.BD_Company model in ListComp) // { // if (string.IsNullOrEmpty(CompHTML)) // { // CompHTML += "<a href=\"javascript:;\" title='" + model.CompName + "' tip='" + Common.DesEncrypt(ListCompUser.Where(T => T.CType == 2 && T.CompID == model.ID).ToList()[0].ID.ToString(), Common.EncryptKey) + "'>" + model.CompName + "</a>"; // } // else // { // CompHTML += "<i>|</i><a href=\"javascript:;\" title='" + model.CompName + "' tip='" + Common.DesEncrypt(ListCompUser.Where(T => T.CType == 2 && T.CompID == model.ID).ToList()[0].ID.ToString(), Common.EncryptKey) + "' >" + model.CompName + "</a>"; // } // } // WriteHTML += CompHTML; // WriteHTML += (ListComp.Count > 0 ? "</div>" : ""); //} } else { WriteHTML += "用户没有绑定任何企业。"; } WriteHTML += " </div><div class=\"bg\"></div></div>"; } }