public void DataBinds() { int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.createdate", false, " users.Tel,Identitys,Email,Address,SYS_CompUser.id,UserName,SYS_CompUser.compid,trueName,utype Type,Phone,SYS_CompUser.IsEnabled,SYS_CompUser.createdate,SYS_CompUser.CompID ,OpenID,Sex ", JoinTableStr, " and SYS_CompUser.id=" + KeyID + "", out pageCount, out Counts); if (LUser.Rows.Count > 0) { lblCompName.InnerText = Common.GetCompValue(LUser.Rows[0]["CompID"].ToString().ToInt(0), "CompName") == null ? "" : Common.GetCompValue(LUser.Rows[0]["CompID"].ToString().ToInt(0), "CompName").ToString(); lblUserName.InnerText = LUser.Rows[0]["UserName"].ToString(); lblOpenID.InnerText = LUser.Rows[0]["OpenID"].ToString(); lblSex.InnerText = LUser.Rows[0]["Sex"].ToString(); lblPhone.InnerText = LUser.Rows[0]["Phone"].ToString(); lblTel.InnerText = LUser.Rows[0]["Tel"].ToString(); lblIdentitys.InnerText = LUser.Rows[0]["Identitys"].ToString(); lblTrueName.InnerText = LUser.Rows[0]["TrueName"].ToString(); lblIsEnabled.InnerHtml = LUser.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1 ? "启用" : "<i style='color:red;'>禁用</i>"; lblEmail.InnerText = LUser.Rows[0]["Email"].ToString(); lblAddress.InnerText = LUser.Rows[0]["Address"].ToString(); } else { Response.Write("该用户不存在。"); Response.End(); } }
public void DataBinds() { int pageCount = 0; int Counts = 0; 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); } } string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 inner join BD_Company on SYS_CompUser.CompID=BD_Company.ID and BD_Company.dr=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(Pager.PageSize, Pager.CurrentPageIndex, "SYS_CompUser.createdate", false, "SYS_CompUser.CompID, SYS_CompUser.id,UserName,SYS_CompUser.Disid,trueName,utype Type,Users.Phone,SYS_CompUser.IsEnabled,SYS_CompUser.createdate ", JoinTableStr, SearchWhere(), out pageCount, out Counts); this.Rpt_Disuser.DataSource = LUser; this.Rpt_Disuser.DataBind(); Pager.RecordCount = Counts; page = Pager.CurrentPageIndex.ToString(); }
public string ExistsUserPhone(string Phone) { if (KeyID != 0) { List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("Userid", " id=" + KeyID + " and DisID=" + DisID + " and ctype=2 ", ""); string id = ListCompUser.Count > 0 ? ListCompUser[0].UserID.ToString() : "0"; if (Common.GetUserExists("Phone", Phone, id)) { return("{ \"result\":true}"); } else { return("{ \"result\":false}"); } } else { if (Common.GetUserExists("Phone", Phone)) { return("{ \"result\":true}"); } else { return("{ \"result\":false}"); } } }
public void DataBinds() { int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.createdate", false, " users.Tel,Identitys,Email,Address,SYS_CompUser.id,UserName,SYS_CompUser.compid,trueName,utype Type,Phone,SYS_CompUser.IsEnabled,SYS_CompUser.createdate,SYS_CompUser.DisID ,OpenID,Sex ", JoinTableStr, " and SYS_CompUser.id=" + KeyID + "", out pageCount, out Counts); if (LUser.Rows.Count > 0) { lblDisName.InnerText = Common.GetDisValue(LUser.Rows[0]["DisID"].ToString().ToInt(0), "disname").ToString(); lblUname.InnerText = LUser.Rows[0]["UserName"].ToString(); lblOpenID.InnerText = LUser.Rows[0]["OpenID"].ToString(); lblSex.InnerText = LUser.Rows[0]["Sex"].ToString(); lblPhone.InnerText = LUser.Rows[0]["Phone"].ToString(); lblTel.InnerText = LUser.Rows[0]["Tel"].ToString(); lblIdentitys.InnerText = LUser.Rows[0]["Identitys"].ToString(); lblTrueName.InnerText = LUser.Rows[0]["TrueName"].ToString(); lblIsEnabled.InnerHtml = LUser.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1 ? "启用" : "<i style='color:red;'>禁用</i>"; lblEmail.InnerText = LUser.Rows[0]["Email"].ToString(); //lblAddress.InnerText = user.Address; } else { JScript.AlertMethod(this, "该用户不存在!", JScript.IconOption.错误, " function (){ location.href='DisUserList.aspx' }"); return; } }
public void DataBinds() { if (KeyID > 0) { int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.createdate", false, "UserPwd, users.Tel,Identitys,Email,Address,SYS_CompUser.id,UserName,SYS_CompUser.compid,trueName,utype Type,Phone,SYS_CompUser.IsEnabled,SYS_CompUser.createdate,SYS_CompUser.CompID ,OpenID,Sex ", JoinTableStr, " and SYS_CompUser.id=" + KeyID + "", out pageCount, out Counts); if (LUser.Rows.Count > 0) { txtUname.Value = LUser.Rows[0]["UserName"].ToString(); txtTrueName.Value = LUser.Rows[0]["UserName"].ToString(); txtOpenID.Value = LUser.Rows[0]["OpenID"].ToString(); txtUpwd.Attributes.Add("value", LUser.Rows[0]["UserPwd"].ToString()); if (LUser.Rows[0]["IsEnabled"].ToString().ToInt(0) == 0) { rdEnabledYes.Checked = false; rdEnabledNo.Checked = true; } if (LUser.Rows[0]["Sex"].ToString() == "女") { rdMan.Checked = false; rdWomen.Checked = true; } txtMobil.Value = LUser.Rows[0]["Phone"].ToString(); txtPhone.Value = LUser.Rows[0]["Tel"].ToString(); txtPId.Value = LUser.Rows[0]["Identitys"].ToString(); txtEmail.Value = LUser.Rows[0]["Email"].ToString(); LUser.Rows[0]["Address"].ToString(); } } }
protected void btnEdit_Click(object sender, EventArgs e) { if (KeyID > 0) { List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and id=" + KeyID + "", ""); if (ListCompUser.Count > 0) { SqlTransaction Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(ListCompUser[0].UserID); user.TrueName = Common.NoHTML(txtTrueName.Value.Trim()); user.OpenID = Common.NoHTML(txtOpenID.Value.Trim()); if (rdMan.Checked) { user.Sex = "男"; } else { user.Sex = "女"; } user.Tel = Common.NoHTML(txtPhone.Value.Trim()); if (txtUpwd.Text.Trim() != user.UserPwd) { user.UserPwd = Util.md5(txtUpwd.Text.Trim()); } user.Identitys = Common.NoHTML(txtPId.Value.Trim()); ListCompUser[0].IsEnabled = rdEnabledYes.Checked ? 1 : 0; user.Email = Common.NoHTML(txtEmail.Value.Trim()); user.Address = Common.NoHTML(txtAddress.Value.Trim()); new Hi.BLL.SYS_Users().Update(user, Tran); new Hi.BLL.SYS_CompUser().Update(ListCompUser[0], Tran); Tran.Commit(); ClientScript.RegisterStartupScript(this.GetType(), "msg", "<script>window.location.href='CompUserInfo.aspx?KeyID=" + KeyID + "';</script>"); } } }
/// <summary> /// 禁用 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Del(object sender, EventArgs e) { Hi.Model.SYS_CompUser User = new Hi.BLL.SYS_CompUser().GetModel(KeyID); List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("top 1 *", " UserID=" + KeyID + " and DisID=" + DisID + " and ctype=2 ", ""); if (ListCompUser.Count > 0) { if (ListCompUser[0].UType == 5) { JScript.AlertMsgOne(this, "该用户为管理员,不可禁用!", JScript.IconOption.错误, 2500); return; } else { ListCompUser[0].IsEnabled = 0; ListCompUser[0].ts = DateTime.Now; ListCompUser[0].modifyuser = UserID; if (new Hi.BLL.SYS_CompUser().Update(ListCompUser[0])) { this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "msg", "<script>window.parent.save();</script>"); } } } else { JScript.AlertMsgOne(this, "用户不存在!", JScript.IconOption.错误, 2500); return; } DataBinds(); }
protected void btn_Use(object sender, EventArgs e) { List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("top 1 *", " UserID=" + KeyID + " and DisID=" + DisID + " and ctype=2 ", ""); if (ListCompUser.Count > 0) { List <Hi.Model.SYS_Role> ListRole = new Hi.BLL.SYS_Role().GetList("RoleName,IsEnabled", " dr=0 and id=" + ListCompUser[0].RoleID + "", ""); if (ListRole.Count > 0) { if (ListRole[0].IsEnabled == 0) { JScript.AlertMsgOne(this, "请先启用该人员所在岗位(" + ListRole[0].RoleName + ")!", JScript.IconOption.错误, 2500); return; } } ListCompUser[0].IsEnabled = 1; ListCompUser[0].ts = DateTime.Now; ListCompUser[0].modifyuser = UserID; if (new Hi.BLL.SYS_CompUser().Update(ListCompUser[0])) { this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "msg", "<script>window.parent.save();</script>"); } } else { JScript.AlertMsgOne(this, "用户不存在!", JScript.IconOption.错误, 2500); return; } DataBinds(); }
protected void btn_Use(object sender, EventArgs e) { Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID); if (Dis != null) { List <Hi.Model.SYS_CompUser> luser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and DisID=" + KeyID + " and Utype in (1,5) and Ctype=2 and CompID=" + this.CompID, ""); foreach (Hi.Model.SYS_CompUser model in luser) { model.IsEnabled = 1; model.ts = DateTime.Now; model.modifyuser = Common.UserID(); new Hi.BLL.SYS_CompUser().Update(model); } if (Request["nextstep"] + "" == "1") { Response.Redirect("DisList.aspx?nextstep=1"); } else { Response.Redirect("DisInfo.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey) + "&type=2"); } } }
public void DataBindComp() { if (!string.IsNullOrWhiteSpace(ComList[0].CustomCompinfo)) { DivContent.InnerHtml = ComList[0].CustomCompinfo; } else { DivContent.InnerHtml = ComList[0].CompInfo; } LoginModel logUser = HttpContext.Current.Session["UserModel"] as LoginModel; if (logUser != null) { lblAddress.InnerHtml = "地 址:" + ComList[0].Address; if (!string.IsNullOrWhiteSpace(ComList[0].Principal)) { lblPrincipal.InnerHtml = "联系人:" + ComList[0].Principal; } if (!string.IsNullOrWhiteSpace(ComList[0].Phone)) { lblPhone.InnerHtml = "电 话:" + ComList[0].Phone; } lbllogin.Visible = false; List <Hi.Model.SYS_CompUser> User2 = new Hi.BLL.SYS_CompUser().GetList("", "isnull(dr,0)=0 and IsEnabled=1 and utype=4 and CompID=" + ViewState["Compid"], ""); if (User2.Count > 0) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(User2[0].UserID); if (User != null) { if (!string.IsNullOrWhiteSpace(ComList[0].Principal)) { lblPrincipal.InnerHtml = "联系人:" + ComList[0].Principal; } else { lblPrincipal.InnerHtml = "联系人:" + User.TrueName; } if (!string.IsNullOrWhiteSpace(ComList[0].Phone)) { lblPhone.InnerHtml = "电 话:" + ComList[0].Phone; } else { lblPhone.InnerHtml = "电 话:" + User.Phone; } } } } else { lblPrincipal.InnerHtml = "<i>联系人:</i>" + "***"; lblPhone.InnerHtml = "<i>电 话:</i>" + "***"; lblAddress.InnerHtml = "<i>地 址:</i>" + "***"; lbllogin.InnerHtml = "<a href=\"/login.html\"><i style=\" color:Red;\">请先登录>></i></a>"; } }
protected void btn_Del(object sender, EventArgs e) { Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID); if (Dis != null) { //if (Dis.AuditState == 2 && Dis.IsEnabled == 1) //{ // JScript.AlertMsgOne(this, "已审核未被禁用的代理商不允许删除!", JScript.IconOption.错误); // return; //} //Dis.dr = 1; //Dis.ts = DateTime.Now; //Dis.modifyuser = Common.UserID(); List <int> ListUserid = new List <int>(); List <int> ListDelUserid = new List <int>(); List <Hi.Model.SYS_CompUser> luser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and DisID=" + KeyID + " and Utype in (1,5) and Ctype=2 and CompID=" + this.CompID, ""); foreach (Hi.Model.SYS_CompUser model in luser) { if (model.IsAudit == 2 && model.IsEnabled == 1) { JScript.AlertMsgOne(this, "已审核未被禁用的代理商不允许删除!", JScript.IconOption.错误); return; } if (!ListUserid.Contains(model.UserID)) { List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("id", " dr=0 and Userid=" + model.UserID + " and CompID=" + this.CompID, ""); if (ListCompUser.Count == 1) { ListDelUserid.Add(model.UserID); } ListUserid.Add(model.UserID); } model.dr = 1; model.ts = DateTime.Now; model.modifyuser = Common.UserID(); new Hi.BLL.SYS_CompUser().Update(model); } if (ListDelUserid.Count > 0) { List <Hi.Model.SYS_Users> ListUsers = new Hi.BLL.SYS_Users().GetList("", " dr=0 and id in(" + string.Join(",", ListDelUserid) + ")", ""); foreach (Hi.Model.SYS_Users model in ListUsers) { model.dr = 1; model.ts = DateTime.Now; model.modifyuser = Common.UserID(); new Hi.BLL.SYS_Users().Update(model); } } //string Phone = Common.GetDis(Dis.ID, "Phone"); //string msg = "您所注册的代理商:" + Dis.DisName + "已注销![ " + Common.GetCompValue(CompID, "CompName") + " ]"; //Common.GetPhone(Phone, msg); JScript.AlertMethod(this, "删除成功!", JScript.IconOption.错误, "function(){ window.location.href='DisList.aspx'; }"); } }
public void DataBinds() { if (KeyID != 0) { //Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(KeyID); int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable dt = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.ID", true, "SYS_CompUser.DisID,SYS_CompUser.id,Address,SYS_CompUser.RoleId,UserName,SYS_CompUser.createdate,TrueName,Phone,Identitys,Email,SYS_CompUser.IsEnabled,SYS_CompUser.CompID", JoinTableStr, "and SYS_CompUser.UserID= " + KeyID, out pageCount, out Counts); if (dt != null && dt.Rows.Count > 0) { if (dt.Rows[0]["DisID"].ToString().ToInt(0) != this.DisID) { JScript.AlertMsgOne(this, "该用户不允许查看!", JScript.IconOption.错误, 2500); return; } if (dt.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1) { UseIcon.Visible = false; NUseIcon.Visible = true; DleteIcon.Visible = false; } else { NUseIcon.Visible = false; UseIcon.Visible = true; DleteIcon.Visible = true; } //Hi.Model.SYS_Role ll = new Hi.BLL.SYS_Role().GetModel(dt.Rows[0]["RoleID"].ToString().ToInt(0)); lblTrueName.InnerText = dt.Rows[0]["TrueName"].ToString(); //lblSex.InnerText = User.Sex; lblPhone.InnerText = dt.Rows[0]["Phone"].ToString(); //lblTel.InnerText = User.Tel; lblIdentitys.InnerText = dt.Rows[0]["Identitys"].ToString(); lblIsEnabled.InnerText = dt.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1 ? "启用" : "禁用"; lblEmail.InnerText = dt.Rows[0]["Email"].ToString(); //if (ll != null) //{ // lblRoleId.InnerText = ll.RoleName; //} //lblUserLoginName.InnerText = User.UserLoginName.ToString(); lblUserName.InnerText = dt.Rows[0]["UserName"].ToString(); lblAddress.InnerText = dt.Rows[0]["Address"].ToString();; } else { JScript.AlertMsgOne(this, "用户不存在!", JScript.IconOption.错误, 2500); return; } } else { JScript.AlertMsgOne(this, "数据错误!", JScript.IconOption.错误, 2500); return; } }
/// <summary> /// 获取登录用户厂商ID /// </summary> /// <param name="UserID"></param> /// <returns></returns> public static int GetUserCompID(string UserID) { List <Hi.Model.SYS_CompUser> culist = new Hi.BLL.SYS_CompUser().GetList("", " UserID=" + UserID + " and Ctype=1 and UType=4", ""); if (culist != null && culist.Count > 0) { return(culist[0].CompID); } return(0); }
protected void btn_Save1(object sender, EventArgs e) { Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(this.DisID); if (Dis != null) { if (Common.DisExistsAttribute("DisName", txtDisName.Value.Trim(), this.CompID.ToString(), this.DisID.ToString())) { JScript.AlertMsgOne(this, "代理商已存在!", JScript.IconOption.错误, 2500); return; } Dis.Province = Common.NoHTML(hidProvince.Value.Trim()); Dis.City = Common.NoHTML(hidCity.Value.Trim()); Dis.Area = Common.NoHTML(hidArea.Value.Trim()); Dis.DisName = Common.NoHTML(txtDisName.Value.Trim()); Dis.Licence = Common.NoHTML(txtLicence.Value.Trim()); Dis.Tel = Common.NoHTML(txtTel.Value.Trim()); Dis.Principal = Common.NoHTML(txtname.Value); Dis.Phone = Common.NoHTML(txtnamephone.Value); Dis.Zip = Common.NoHTML(txtZip.Value.Trim()); Dis.Fax = Common.NoHTML(txtFax.Value.Trim()); Dis.Address = Common.NoHTML(txtAddress.Value.Trim()); Dis.Leading = Common.NoHTML(txtLeading.Value.Trim()); Dis.LeadingPhone = Common.NoHTML(txtLeadingPhone.Value.Trim()); if (!string.IsNullOrEmpty(HidFfileName.Value)) { if (Dis.pic == "") { Dis.pic = Common.NoHTML(HidFfileName.Value); } else { Dis.pic += "," + Common.NoHTML(HidFfileName.Value); } } Dis.ts = DateTime.Now; Dis.modifyuser = this.UserID; if (new Hi.BLL.BD_Distributor().Update(Dis)) { List <Hi.Model.SYS_CompUser> user2 = new Hi.BLL.SYS_CompUser().GetList("UserID", " isnull(dr,0)=0 and disId='" + this.DisID + "' and utype=5", ""); if (user2.Count > 0) { Hi.Model.SYS_Users u = new Hi.BLL.SYS_Users().GetModel(user2[0].UserID); if (u != null) { u.ts = DateTime.Now; u.modifyuser = this.UserID; u.TrueName = Common.NoHTML(txtUserTrueName.Value); new Hi.BLL.SYS_Users().Update(u); } } Response.Redirect("PhoneEdit.aspx?type=hf"); } } }
//public void DataBinds() //{ // int pageCount = 0; // int Counts = 0; // //每页显示的数据设置 // 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); // } // } // string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; // DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(Pager.PageSize, Pager.CurrentPageIndex, "SYS_CompUser.createdate", false, " SYS_CompUser.id,UserID,UserName,SYS_CompUser.createdate,TrueName,Phone,Identitys,Email,SYS_CompUser.IsEnabled ", JoinTableStr, SearchWhere(), out pageCount, out Counts); // this.Rpt_Company.DataSource = LUser; // this.Rpt_Company.DataBind(); // Pager.RecordCount = Counts; // page = Pager.CurrentPageIndex.ToString(); //} public void BinDisUser() { int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(Pager.PageSize, Pager.CurrentPageIndex, "SYS_CompUser.createdate", false, "SYS_CompUser.id,SYS_CompUser.userid,SYS_CompUser.RoleId,UserName,SYS_CompUser.createdate,TrueName,Phone,Identitys,Email,SYS_CompUser.IsEnabled ", JoinTableStr, SearchWhere(), out pageCount, out Counts); this.Rpt_Company.DataSource = LUser; this.Rpt_Company.DataBind(); page = Pager.CurrentPageIndex.ToString(); }
public void DataBinds() { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(CompID); if (comp != null) { if (comp.ShortName == "" && comp.CompName.Length <= 12) { txtShortName.Value = comp.CompName; } else { txtShortName.Value = comp.ShortName; } txtOrcode.Value = comp.OrganizationCode; txtCompName.Value = comp.CompName; lblCompCode.InnerText = comp.CompCode; txtTel.Value = comp.Tel; txtZip.Value = comp.Zip; txtFax.Value = comp.Fax; txtLicence.Value = comp.creditCode; txtAccount.Value = comp.Account; txtAddress.Value = comp.Address; txtLegal.Value = comp.Legal; txtIdentitys.Value = comp.Identitys; txtPrincipal.Value = comp.Principal; txtPhone.Value = comp.Phone; txtInfo.Value = comp.ManageInfo; txtLegalTel.Value = comp.LegalTel; txtIndusName.SelectedValue = comp.IndID.ToString(); QQ.Value = comp.QQ; if (comp.HotShow == 0) { rdHotShowNo.Checked = true; rdHotShowYes.Checked = false; } //txtFinanceCode.Value = comp.FinanceCode.ToString(); //txtFinanceName.Value = comp.FinanceName.ToString(); List <Hi.Model.SYS_CompUser> user2 = new Hi.BLL.SYS_CompUser().GetList("", " isnull(dr,0)=0 and compid='" + CompID + "' and utype=4", ""); if (user2.Count > 0) { Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(user2[0].UserID); if (user != null) { txtUsername.Disabled = true; txtUserPhone.Disabled = true; txtUsername.Value = user.UserName; txtUserPhone.Value = user.Phone; txtUserTrueName.Value = user.TrueName; } } } }
protected void btn_NUse(object sender, EventArgs e) { List <Hi.Model.SYS_Role> ListRole = new Hi.BLL.SYS_Role().GetList("", " dr=0 and id=" + KeyID + " and DisID=" + DisID + " ", ""); if (ListRole.Count > 0) { if (ListRole[0].RoleName == "企业管理员") { JScript.AlertMsgOne(this, "代理商管理员岗位不允许禁用!", JScript.IconOption.错误); return; } } else { JScript.AlertMsgOne(this, "禁用的岗位不存在!", JScript.IconOption.错误); return; } SqlTransaction Tran = null; try { Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and RoleID=" + ListRole[0].ID + " and Disid=" + DisID + " and Ctype=2 ", ""); foreach (Hi.Model.SYS_CompUser model in ListCompUser) { model.IsEnabled = 0; model.ts = DateTime.Now; model.modifyuser = UserID; new Hi.BLL.SYS_CompUser().Update(model, Tran); } Tran.Commit(); } catch { if (Tran != null) { if (Tran.Connection != null) { Tran.Rollback(); } JScript.AlertMethod(this, "操作失败!", JScript.IconOption.错误, "function(){ window.location.href=window.location.href; }"); } } ListRole[0].IsEnabled = 0; ListRole[0].ts = DateTime.Now; ListRole[0].modifyuser = UserID; if (new Hi.BLL.SYS_Role().Update(ListRole[0])) { Response.Redirect("RoleList.aspx"); } }
public void Databind() { Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(this.DisID); if (Dis != null) { hidProvince.Value = Dis.Province; hidCity.Value = Dis.City; hidArea.Value = Dis.Area; txtDisName.Value = Dis.DisName; txtLicence.Value = Dis.Licence; txtTel.Value = Dis.Tel; txtname.Value = Dis.Principal; txtnamephone.Value = Dis.Phone; txtZip.Value = Dis.Zip; txtFax.Value = Dis.Fax; txtAddress.Value = Dis.Address; txtLeading.Value = Dis.Leading; txtLeadingPhone.Value = Dis.LeadingPhone; List <Hi.Model.SYS_CompUser> user2 = new Hi.BLL.SYS_CompUser().GetList("", " isnull(dr,0)=0 and disId='" + this.DisID + "' and utype=5", ""); if (user2.Count > 0) { Hi.Model.SYS_Users u = new Hi.BLL.SYS_Users().GetModel(user2[0].UserID); if (u != null) { //List<Hi.Model.SYS_Users> u = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and DisID='" + this.DisID + "' and type=5", ""); //if (u.Count > 0) //{ txtUsername.Disabled = true; txtUserPhone.Disabled = true; txtUsername.Value = u.UserName; txtUserPhone.Value = u.Phone; txtUserTrueName.Value = u.TrueName; } } else { List <Hi.Model.SYS_Users> users = new Hi.BLL.SYS_Users().GetList("", " DisID='" + this.DisID + "'", ""); if (users.Count > 0) { //List<Hi.Model.SYS_Users> u = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and DisID='" + this.DisID + "' and type=5", ""); //if (u.Count > 0) //{ txtUsername.Disabled = true; txtUserPhone.Disabled = true; txtUsername.Value = users[0].UserName; txtUserPhone.Value = users[0].Phone; txtUserTrueName.Value = users[0].TrueName; } } } }
public void UserDataBind() { int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(Pager.PageSize, Pager.CurrentPageIndex, "SYS_CompUser.createdate", false, " SYS_CompUser.id,UserName,SYS_CompUser.createdate,TrueName,Phone,Identitys,Email,SYS_CompUser.IsEnabled,utype Type,isaudit ", JoinTableStr, " and utype in(3,4) and ctype=1 and SYS_CompUser.compid=" + KeyID + " ", out pageCount, out Counts); this.Rpt_User.DataSource = LUser; this.Rpt_User.DataBind(); Pager1.RecordCount = Counts; page1 = Pager1.CurrentPageIndex.ToString(); }
protected void btn_NUse(object sender, EventArgs e) { Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID); string sql = "select * from SYS_CompUser where ISNULL(dr,0)=0 and DisID=" + KeyID; DataTable userDT = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; if (userDT.Rows.Count > 0) { SqlTransaction Tran = null; try { Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); for (int i = 0; i < userDT.Rows.Count; i++) { Hi.Model.SYS_CompUser user = new Hi.BLL.SYS_CompUser().GetModel(Convert.ToInt32(userDT.Rows[i]["ID"].ToString())); user.IsEnabled = 0; user.ts = DateTime.Now; user.modifyuser = UserID; new Hi.BLL.SYS_CompUser().Update(user, Tran); } Tran.Commit(); } catch { if (Tran != null) { if (Tran.Connection != null) { Tran.Rollback(); } JScript.AlertMethod(this, "操作失败!", JScript.IconOption.错误, "function(){ window.location.href=window.location.href; }"); } } } if (Dis != null) { Dis.IsEnabled = 0; Dis.ts = DateTime.Now; Dis.modifyuser = UserID; if (new Hi.BLL.BD_Distributor().Update(Dis)) { if (Request["nextstep"] + "" == "1") { Response.Redirect("DisList.aspx?nextstep=1"); } else { Response.Redirect("DisInfo.aspx?KeyID=" + KeyID.ToString() + "&type=2"); } } } }
protected void btn_Del(object sender, EventArgs e) { Hi.Model.SYS_CompUser user = new Hi.BLL.SYS_CompUser().GetModel(KeyID); if (user != null) { user.dr = 1; user.modifyuser = UserID; user.ts = DateTime.Now; if (new Hi.BLL.SYS_CompUser().Update(user)) { JScript.AlertMethod(this, "用户删除成功!", JScript.IconOption.正确, "function(){ window.location.href='DisUserList.aspx'; }"); } } }
public void EditOpenID(string JSon, string version) { try { string openid = string.Empty; string CompUserID = string.Empty; JsonData JInfo = JsonMapper.ToObject(JSon); if (JInfo.Count > 0 && JInfo["CompUserID"].ToString() != "") { openid = JInfo["OpenID"].ToString().Trim(); CompUserID = JInfo["CompUserID"].ToString().Trim(); } else { return; } Hi.Model.SYS_CompUser compuser = new Hi.BLL.SYS_CompUser().GetModel(int.Parse(CompUserID)); if (compuser == null || compuser.IsAudit != 2 || compuser.dr == 1 || compuser.IsEnabled != 1) { return; } Hi.BLL.SYS_Users bll_user = new Hi.BLL.SYS_Users(); Hi.Model.SYS_Users user = bll_user.GetModel(compuser.UserID); if (user == null || user.AuditState != 2 || user.dr == 1 || user.IsEnabled != 1) { return; } if (openid == "") { user.OpenID = ""; } else { user.OpenID = openid + "&&" + compuser.ID; } user.ts = DateTime.Now; user.modifyuser = user.ID; bll_user.Update(user); } catch (Exception ex) { Common.CatchInfo(ex.Message + ":" + ex.StackTrace, "EditOpenID:" + JSon); return; } }
protected void btn_Delete(object sender, EventArgs e) { List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("top 1 *", " UserID=" + KeyID + " and DisID=" + DisID + " and ctype=2 ", ""); if (ListCompUser.Count > 0) { if (ListCompUser[0].UType == 5) { JScript.AlertMsgOne(this, "该用户为管理员,不可删除!", JScript.IconOption.错误, 2500); return; } else { List <int> ListUserid = new List <int>(); List <int> ListDelUserid = new List <int>(); foreach (Hi.Model.SYS_CompUser model in ListCompUser) { if (!ListUserid.Contains(model.UserID)) { List <Hi.Model.SYS_CompUser> luser = new Hi.BLL.SYS_CompUser().GetList("id", " dr=0 and Userid=" + model.UserID + " ", ""); if (luser.Count == 1) { ListDelUserid.Add(model.UserID); } ListUserid.Add(model.UserID); } model.dr = 1; model.ts = DateTime.Now; model.modifyuser = Common.UserID(); new Hi.BLL.SYS_CompUser().Update(model); } if (ListDelUserid.Count > 0) { List <Hi.Model.SYS_Users> ListUsers = new Hi.BLL.SYS_Users().GetList("", " dr=0 and id in(" + string.Join(",", ListDelUserid) + ")", ""); foreach (Hi.Model.SYS_Users model in ListUsers) { model.dr = 1; model.ts = DateTime.Now; model.modifyuser = Common.UserID(); new Hi.BLL.SYS_Users().Update(model); } } //this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "msg", "<script>window.parent.save();</script>"); Response.Redirect("UsersList.aspx"); } } }
/// <summary> /// 用户是否存在用户明细 /// </summary> public static bool ExistRoleComp() { if (HttpContext.Current.Session != null) { if (HttpContext.Current.Session["UserModel"] is LoginModel) { LoginModel UserModel = HttpContext.Current.Session["UserModel"] as LoginModel; List <Hi.Model.SYS_CompUser> copmuserlist = new Hi.BLL.SYS_CompUser().GetList("", " isnull(dr,0)=0 and UserID=" + UserModel.UserID + " and CType=2 and IsAudit=2 and IsEnabled=1 and UType in(1,5)", ""); if (copmuserlist != null && copmuserlist.Count > 0) { return(true); } } } return(false); }
public void DataBind() { int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.createdate", false, " Users.id,Users.Phone ", JoinTableStr, " and SYS_CompUser.Compid=" + KeyID + " and Ctype=1 and Utype=4 ", out pageCount, out Counts); if (LUser.Rows.Count > 0) { txt_OldPhone.Value = LUser.Rows[0]["Phone"].ToString(); ViewState["Userid"] = LUser.Rows[0]["id"].ToString(); } else { Response.Write("用户异常"); Response.End(); } }
public void DataBinds() { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(CompID); if (comp != null) { lblShortName.InnerText = comp.ShortName; lblCompName.InnerText = comp.CompName; lblCompCode.InnerText = comp.CompCode; lblTel.InnerText = comp.Tel; lblLicence.InnerText = comp.creditCode; lblOrCode.InnerText = comp.OrganizationCode; lblZip.InnerText = comp.Zip; lblFax.InnerText = comp.Fax; lblAccount.InnerText = comp.Account; lblAddress.InnerText = comp.Address; lblIndusName.Id = comp.IndID.ToString(); lblLegal.InnerText = comp.Legal; lblIdentitys.InnerText = comp.Identitys; lblPrincipal.InnerText = comp.Principal; lblPhone.InnerText = comp.Phone; lblInfo.InnerText = comp.ManageInfo; lblLegalTel.InnerText = comp.LegalTel; lblIsHot.InnerHtml = comp.HotShow == 1 ? "是" : "<i style='color:red;'>否</i>"; QQ.InnerHtml = comp.QQ; //lblFinanceCode.InnerText = comp.FinanceCode; //lblFinanceName.InnerText = comp.FinanceName; List <Hi.Model.SYS_CompUser> user2 = new Hi.BLL.SYS_CompUser().GetList("", " isnull(dr,0)=0 and compid='" + CompID + "' and utype=4", ""); if (user2.Count > 0) { Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(user2[0].UserID); if (user != null) { //List<Hi.Model.SYS_Users> user = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and compid='" + CompID + "' and type=4", ""); // if (user.Count > 0) // { lblUsername.InnerText = user.UserName; lblUserPhone.InnerText = user.Phone; lblUserTrueName.InnerText = user.TrueName; } } } }
protected void btnSave_Click(object sender, EventArgs e) { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(KeyID); if (comp != null) { comp.Tel = Common.NoHTML(txtTel.Value.Trim()); comp.Zip = Common.NoHTML(txtZip.Value.Trim()); comp.Fax = Common.NoHTML(txtFax.Value.Trim()); comp.Principal = Common.NoHTML(txtPrincipal.Value.Trim()); comp.Address = Common.NoHTML(txtAddress.Value.Trim()); comp.CompLogo = Common.NoHTML(HDCompPath.Value); comp.ShopLogo = Common.NoHTML(HdShopLogoPath.Value); comp.CompNewLogo = Common.NoHTML(HdNewShopLogoPath.Value); comp.CustomCompinfo = txtCustomInfo.Text; if (txtPhone.Value.Trim() == "") { List <Hi.Model.SYS_CompUser> User2 = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and utype=4 and CompID=" + KeyID + "", ""); if (User2.Count > 0) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(User2[0].UserID); if (User != null) { comp.Phone = User.Phone; } } //List<Hi.Model.SYS_Users> User = new Hi.BLL.SYS_Users().GetList("", " dr=0 and type=4 and CompID=" + KeyID + "", ""); //if (User.Count > 0) //{ // comp.Phone = User[0].Phone; //} } else { comp.Phone = Common.NoHTML(txtPhone.Value.Trim()); } if (new Hi.BLL.BD_Company().Update(comp)) { Response.Redirect("CompFixture.aspx?KeyID=" + KeyID); } } }
protected void btnSave_Click(object sender, EventArgs e) { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(CompID); if (comp != null) { comp.Tel = Common.NoHTML(txtTel.Value.Trim()); comp.Fax = Common.NoHTML(txtFax.Value.Trim()); comp.Principal = Common.NoHTML(txtPrincipal.Value.Trim()); comp.Address = Common.NoHTML(txtAddress.Value.Trim()); if (txtPhone.Value.Trim() != "") { comp.Phone = Common.NoHTML(txtPhone.Value.Trim()); } else { List <Hi.Model.SYS_CompUser> User2 = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and utype=4 and CompID=" + CompID + "", ""); if (User2.Count > 0) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(User2[0].UserID); if (User != null) { comp.Phone = Common.NoHTML(User.Phone); } } } comp.BrandInfo = Common.NoHTML(this.BrandIfon.Value.Trim()); comp.CompLogo = Common.NoHTML(HDCompPath.Value); comp.CustomCompinfo = txtCustomInfo.Text; if (new Hi.BLL.BD_Company().Update(comp)) { if (Request["nextstep"] + "" == "1") { JScript.AlertMethod(this, "恭喜您成功入驻医站通,您的商城您做主,尽情享受您的电商之旅吧!", JScript.IconOption.笑脸, "function () { onlinkOrder('../newOrder/orderBuy.aspx', 'dkxd') }"); } else { Response.Redirect("CompInfo.aspx"); } } } }
protected void btn_NEnabled(object sender, EventArgs e) { Hi.Model.SYS_CompUser user = new Hi.BLL.SYS_CompUser().GetModel(KeyID); if (user != null) { if (user.IsEnabled == 1) { user.IsEnabled = 0; user.modifyuser = UserID; user.ts = DateTime.Now; if (new Hi.BLL.SYS_CompUser().Update(user)) { JScript.AlertMethod(this, "用户禁用成功", JScript.IconOption.正确, "function(){ window.location.href=window.location.href; }"); } } else { JScript.AlertMethod(this, "用户已是禁用状态!", JScript.IconOption.错误, "function(){ window.location.href=window.location.href; }"); } } }
public void UserDataBind() { int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(Pager.PageSize, Pager.CurrentPageIndex, "SYS_CompUser.createdate", false, " SYS_CompUser.id,UserName,SYS_CompUser.CompID,SYS_CompUser.createdate,TrueName,Phone,Identitys,Email,SYS_CompUser.IsEnabled,utype Type,isaudit ", JoinTableStr, " and utype in(1,5) and ctype=2 and SYS_CompUser.Disid=" + KeyID + " ", out pageCount, out Counts); if (LUser.Rows.Count > 0) { this.Rpt_User.DataSource = LUser; this.Rpt_User.DataBind(); Pager.RecordCount = Counts; page = Pager.CurrentPageIndex.ToString(); } else { List <Hi.Model.SYS_Users> LUser2 = new Hi.BLL.SYS_Users().GetList(" UserName,TrueName,auditstate,5 Type,Phone ", " isnull(dr,0)=0 and disid=" + KeyID + "", ""); this.Rpt_User.DataSource = LUser2; this.Rpt_User.DataBind(); Pager.RecordCount = Counts; page = Pager.CurrentPageIndex.ToString(); } }