protected void A_EditIcon(object sender, EventArgs e) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(this.UserName); orderreturn.ReturnState = (int)Enums.AuditState.提交; orderreturn.ReturnDate = DateTime.Now; orderreturn.ReturnUserID = User.ID; orderreturn.ts = DateTime.Now; orderreturn.modifyuser = User.ID; if (new Hi.BLL.DIS_OrderReturn().Update(orderreturn)) { order.ReturnState = (int)Enums.ReturnState.申请退货; order.ReturnMoneyUser = User.TrueName; order.ReturnMoneyUserId = User.ID; order.ReturnMoneyDate = DateTime.Now; order.ts = DateTime.Now; order.modifyuser = User.ID; if (new Hi.BLL.DIS_Order().Update(order)) { Utils.AddSysBusinessLog(this.CompID, "Order", KeyID.ToString(), "申请退货", orderreturn.ReturnContent); new Common().GetWxService("4", KeyID.ToString(), "1"); string str = "\"str\":true"; str = "{" + str + "}"; Response.Write(str); Response.End(); } } }
protected void btnDelete_Click(object sender, EventArgs e) { List <Hi.Model.BD_Distributor> dis = new Hi.BLL.BD_Distributor().GetList("", " Compid=" + CompID + "", ""); foreach (Hi.Model.BD_Distributor model in dis) { new Hi.BLL.BD_Distributor().Delete(model.ID); List <Hi.Model.BD_DisAddr> Daddr = new Hi.BLL.BD_DisAddr().GetList("", " disid='" + model.ID + "'", ""); foreach (Hi.Model.BD_DisAddr mo in Daddr) { new Hi.BLL.BD_DisAddr().Delete(mo.ID); } List <Hi.Model.SYS_Users> user = new Hi.BLL.SYS_Users().GetList("", " disid='" + model.ID + "' and type=5", ""); foreach (Hi.Model.SYS_Users mo in user) { new Hi.BLL.SYS_Users().Delete(mo.ID); } } List <Hi.Model.BD_DisType> Dtype = new Hi.BLL.BD_DisType().GetList("", " Compid=" + CompID + "", ""); foreach (Hi.Model.BD_DisType model in Dtype) { new Hi.BLL.BD_DisType().Delete(model.ID); } }
/// <summary> /// 检查登录用户名是否存在 /// </summary> /// <param name="name"></param> /// <param name="value"></param> /// <param name="str"></param> /// <param name="index"></param> /// <param name="Tran"></param> /// <returns></returns> public string UserExistsAttribute(string name, string value, string str, DataRow dr, DataTable dt) { if (string.IsNullOrEmpty(value)) { return(value); } List <Hi.Model.SYS_Users> Dis = new Hi.BLL.SYS_Users().GetList("", " " + name + "='" + value + "' and isnull(dr,0)=0 ", ""); if (Dis.Count > 0) { dr["chkstr"] = value + str + "已存在"; // Eroor = true; //TitleError += "Excel行号为: <i error>" + (index + TitleIndex + 1) + "</i> 的数据有误。" + str + "已存在,请修改后重新导入。<br/>"; //throw new ApplicationException("Excel行号为: <i error>" + (index + 1) + "</i> 的数据有误。" + str + "已存在,请修改后重新导入。<br/>"); } else { for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["username"].ToString() == value.Trim()) { dr["chkstr"] = value + str + "Excel已存在"; return(value); } } } return(value); }
public static string RejectEdit(string KeyID, string Remark) { Common.ResultMessage Msg = new Common.ResultMessage(); Hi.Model.YZT_FirstCamp fcmodel = new Hi.BLL.YZT_FirstCamp().GetModel(KeyID.ToInt(0)); if (fcmodel != null) { fcmodel.Remark = Remark; fcmodel.State = 1; fcmodel.ts = DateTime.Now; if (new Hi.BLL.YZT_FirstCamp().Update(fcmodel)) { Msg.result = true; Hi.Model.SYS_Users usersModel = new Hi.BLL.SYS_Users().GetModel(fcmodel.CreateUserID); string Phone = usersModel == null ? "" : usersModel.Phone; Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(fcmodel.CompID); string compName = comp == null ? "" : comp.CompName; GetPhoneCode pc = new GetPhoneCode(); pc.SendReject(Phone, compName, Remark); } } else { Msg.code = "未查找到数据"; } return(new JavaScriptSerializer().Serialize(Msg)); }
/// <summary> /// 新增业务日志 /// </summary> /// <param name="LogClass">单据名称</param> /// <param name="ApplicationId">业务ID</param> /// <param name="LogType">业务名称 新增、审核、退回、提交...</param> /// <param name="LogRemark">备注</param> /// <param name="UserID">操作人Id</param> public static void AddSysBusinessLog(int CompId, string LogClass, string ApplicationId, string LogType, string LogRemark, string UserID) { try { Hi.Model.SYS_Users userModel = new Hi.BLL.SYS_Users().GetModel(Convert.ToInt32(UserID)); if (userModel != null) { Hi.Model.SYS_SysBusinessLog SysBusinessLogModel = new Hi.Model.SYS_SysBusinessLog(); SysBusinessLogModel.CompID = CompId; SysBusinessLogModel.LogClass = LogClass; SysBusinessLogModel.ApplicationId = Convert.ToInt32(ApplicationId); SysBusinessLogModel.LogType = LogType; SysBusinessLogModel.OperatePersonId = Convert.ToInt32(UserID); SysBusinessLogModel.OperatePerson = userModel.TrueName == "" ? userModel.UserName : userModel.TrueName; SysBusinessLogModel.LogRemark = LogRemark; SysBusinessLogModel.LogTime = DateTime.Now; SysBusinessLogModel.ts = DateTime.Now; new Hi.BLL.SYS_SysBusinessLog().Add(SysBusinessLogModel); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
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>"); } } }
protected void btnAdd_Click(object sender, EventArgs e) { SqlTransaction Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); Hi.Model.SYS_Users user = new Hi.Model.SYS_Users(); if (Common.GetUserExists(txtUserName.Value.Trim())) { JScript.AlertMsg(this, "登录帐号已存在。"); return; } if (Common.GetUserExists("Phone", txtUserPhone.Value.Trim())) { JScript.AlertMsg(this, "手机号码已存在。"); return; } user.UserName = Common.NoHTML(txtUserName.Value.Trim()); user.TrueName = Common.NoHTML(txtUserTrueName.Value.Trim()); user.UserPwd = Util.md5(txtUserPwd.Value.Trim()); user.Phone = Common.NoHTML(txtUserPhone.Value.Trim()); user.AuditState = 2; user.IsEnabled = 1; user.CreateDate = DateTime.Now; user.CreateUserID = UserID; user.ts = DateTime.Now; user.modifyuser = UserID; int userid = new Hi.BLL.SYS_Users().Add(user, Tran); Hi.Model.SYS_CompUser CompUser = new Hi.Model.SYS_CompUser(); CompUser.CompID = KeyID; CompUser.DisID = 0; CompUser.CreateDate = DateTime.Now; CompUser.CreateUserID = UserID; CompUser.modifyuser = UserID; CompUser.CType = 1; CompUser.UType = 3; CompUser.IsEnabled = 1; CompUser.IsAudit = 2; CompUser.ts = DateTime.Now; CompUser.dr = 0; CompUser.UserID = userid; CompUser.RoleID = 0; new Hi.BLL.SYS_CompUser().Add(CompUser, Tran); //新增角色用户 List <Hi.Model.SYS_Role> list = new Hi.BLL.SYS_Role().GetList("", "isnull(dr,0)=0 and IsEnabled=1 and CompID=" + KeyID + " and RoleName='企业管理员'", ""); Hi.Model.SYS_RoleUser RoleUser = new Hi.Model.SYS_RoleUser(); RoleUser.FunType = 1; RoleUser.UserID = userid; RoleUser.RoleID = list[0].ID; RoleUser.IsEnabled = true; RoleUser.CreateUser = this.UserID.ToString(); RoleUser.CreateDate = DateTime.Now; RoleUser.ts = DateTime.Now; RoleUser.dr = 0; new Hi.BLL.SYS_RoleUser().Add(RoleUser, Tran); Tran.Commit(); JScript.AlertMsgMo(this, "添加成功", "function(){ window.location.href=window.location.href; }"); }
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'; }"); } }
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"); } } }
protected void btnAdd_Click(object sender, EventArgs e) { Hi.Model.SYS_Users user = new Hi.Model.SYS_Users(); int rolid = 0; if (Common.GetUserExists(txtUserName.Value.Trim())) { JScript.AlertMsg(this, "该用户已存在。"); return; } if (!int.TryParse(HidRoid.Value, out rolid) || HidRoid.Value == "-1") { JScript.AlertMsg(this, "未选择岗位。"); return; } if (Common.GetUserExists("Phone", txtUserPhone.Value.Trim())) { JScript.AlertMsg(this, "手机号码已存在。"); return; } SqlTransaction Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); rolid = HidRoid.Value.ToInt(0); user.UserName = Common.NoHTML(txtUserName.Value.Trim()); user.TrueName = Common.NoHTML(txtTrueName.Value.Trim()); user.UserPwd = Util.md5(txtUserPwd.Value.Trim()); user.Phone = Common.NoHTML(txtUserPhone.Value.Trim()); user.AuditState = 2; user.IsEnabled = 1; user.CreateDate = DateTime.Now; user.CreateUserID = UserID; user.ts = DateTime.Now; user.modifyuser = UserID; int userid = new Hi.BLL.SYS_Users().Add(user, Tran); Hi.Model.SYS_CompUser CompUser = new Hi.Model.SYS_CompUser(); CompUser.CompID = TextComp.Compid.ToInt(0); CompUser.DisID = 0; CompUser.CreateDate = DateTime.Now; CompUser.CreateUserID = UserID; CompUser.modifyuser = UserID; CompUser.CType = 1; CompUser.UType = 3; CompUser.IsEnabled = 1; CompUser.IsAudit = 2; CompUser.ts = DateTime.Now; CompUser.dr = 0; CompUser.UserID = userid; CompUser.RoleID = rolid; new Hi.BLL.SYS_CompUser().Add(CompUser, Tran); Tran.Commit(); string str = string.Format("医站通提示:\n尊敬的用户您好,管理员给您创建了一个帐号为{0}的用户,请登录网站查看\n【医站通】", user.UserName); JScript.AlertMsgMo(this, "添加成功", "function(){ window.location.href='CompUserList.aspx?page=" + page + "'; }"); }
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; } } } }
/// <summary> /// 前台帐号 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button2_Click(object sender, EventArgs e) { List <Hi.Model.SYS_Users> ListUsers1 = new Hi.BLL.SYS_Users().GetList("", "", ""); for (int i = 0; i < ListUsers1.Count; i++) { Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(ListUsers1[i].ID); user.UserPwd = SHA1Encrypt(SHA1Encrypt(ListUsers1[i].UserPwd)); bool result = new Hi.BLL.SYS_Users().Update(user); } }
public static Hi.Model.SYS_Users IsLoginedAll(System.Web.UI.Page page) { string OpenUrl = page.Request.AppRelativeCurrentExecutionFilePath; foreach (string key in page.Request.QueryString.Keys) { if (OpenUrl.Contains("?")) { OpenUrl += key + "=" + page.Request.QueryString[key] + "&"; } else { OpenUrl += "?" + key + "=" + page.Request.QueryString[key] + "&"; } } if (OpenUrl[OpenUrl.Length - 1] == '&') { OpenUrl = OpenUrl.Substring(0, OpenUrl.Length - 1); } if (HttpContext.Current.Session != null) { if (HttpContext.Current.Session["UserModel"] is LoginModel) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel((HttpContext.Current.Session["UserModel"] as LoginModel).UserID); if (User != null) { if (User.dr == 0 && User.IsEnabled != 0) { return(User); } else { page.Response.Redirect("~/login.aspx?GetType=" + page.Server.UrlEncode(DesEncrypt(OpenUrl, EncryptKey)), true); } } else { page.Response.Redirect("~/login.aspx?GetType=" + page.Server.UrlEncode(DesEncrypt(OpenUrl, EncryptKey)), true); } } else { page.Response.Redirect("~/login.aspx?GetType=" + page.Server.UrlEncode(DesEncrypt(OpenUrl, EncryptKey)), true); } } else { if (page != null) { page.Response.Redirect("~/login.aspx?GetType=" + page.Server.UrlEncode(DesEncrypt(OpenUrl, EncryptKey)), true); } } return(null); }
protected void Page_Load(object sender, EventArgs e) { if (Common.TypeID() != 3 && Common.TypeID() != 4) { //ClientScript.RegisterStartupScript(this.GetType(), "msg", "<script>alert('');</script>"); //Session.Remove("UserModel"); Session["UserModel"] = null; Session.Clear(); Session.Abandon(); Response.Clear(); JScript.AlertAndRedirect("您不是商家用户,或已登录平台,请查看!", "../index.aspx"); } if (Session["UserModel"] is LoginModel) { LoginModel model = Session["UserModel"] as LoginModel; if (model != null) { //获得用户类型 Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(model.UserID); if (User != null && Common.HasAdminRole(User.ID)) { if (Request["main"] != null) { if (Request["main"].ToString() == "11") { mainstr = "Order/OrderCreateList.aspx"; } else if (Request["main"].ToString() == "12") { mainstr = "Report/CompCollection.aspx"; } else if (Request["main"].ToString() == "13") { mainstr = "Order/OrderShipList.aspx"; } else if (Request["main"].ToString() == "14") { mainstr = "SysManager/DisList.aspx"; } rightFrame.Attributes.Add("src", mainstr); } else { if (string.IsNullOrEmpty(Request["type"])) { mainstr = "jsc.aspx"; rightFrame.Attributes.Add("src", mainstr); } } } } } }
/// <summary> /// 根据ID获取名称 /// </summary> /// <param name="ID"></param> /// <returns></returns> public string GetName(int ID) { Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(ID); if (user != null) { return(user.TrueName); } else { return(ID.ToString()); } }
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 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; } }
public string UserExistsAttribute(string name, string value, string str, int index, SqlTransaction Tran) { if (string.IsNullOrEmpty(value)) { return(value); } List <Hi.Model.SYS_Users> Dis = new Hi.BLL.SYS_Users().GetList("", " " + name + "='" + value + "' and isnull(dr,0)=0 ", "", Tran); if (Dis.Count > 0) { Eroor = true; TitleError += "Excel行号为: <i error>" + (index + TitleIndex + 1) + "</i> 的数据有误。" + str + "已存在,请修改后重新导入。<br/>"; //throw new ApplicationException("Excel行号为: <i error>" + (index + 1) + "</i> 的数据有误。" + str + "已存在,请修改后重新导入。<br/>"); } return(value); }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserModel"] is LoginModel) { LoginModel model = Session["UserModel"] as LoginModel; if (model != null) { //获得用户类型 Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(model.UserID); if (User != null && IsDisAdmin(User.ID)) { Response.Redirect("UserIndex.aspx"); } } } }
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> /// <returns></returns> public static Hi.Model.SYS_Users IsLoginAllUser() { if (HttpContext.Current.Session != null) { if (HttpContext.Current.Session["UserModel"] is LoginModel) { Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel((HttpContext.Current.Session["UserModel"] as LoginModel).UserID); if (user != null) { if (user.dr == 0 && user.IsEnabled != 0) { return(user); } } } } return(null); }
public void DataBinds() { if (Request.QueryString["KeyID"] != null) { Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(KeyID); if (user != null) { if (user.CompID != CompID) { Response.Write("对不起,您没有操作权限!"); Response.End(); } txtUname.Value = user.UserName; txtTrueName.Value = user.UserName; txtOpenID.Value = user.OpenID; txtUpwd.Attributes.Add("value", user.UserPwd); if (user.IsEnabled == 0) { rdEnabledYes.Checked = false; rdEnabledNo.Checked = true; } if (txtUpwd.Text.Trim() != user.UserPwd) { user.UserPwd = Util.md5(txtUpwd.Text.Trim()); } if (user.Sex.Trim() == "女") { rdMan.Checked = false; rdWomen.Checked = true; } txtMobil.Value = user.Phone; txtPhone.Value = user.Tel; txtPId.Value = user.Identitys; txtEmail.Value = user.Email; txtAddress.Value = user.Address; } } 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 btnModify_Click(object sender, EventArgs e) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(UserID); string OldLoginPwd = this.txtOldPassWord.Value.Trim().ToString(); string NewLoginPwd = this.txtNewPassWord.Value.Trim().ToString(); string ConfrimNewPassWord = this.txtConfrimNewPassWord.Value.Trim(); //修改的密码,两次填写不一致 if (ConfrimNewPassWord == NewLoginPwd) { if (User.UserPwd.ToString() == OldLoginPwd) { if (OldLoginPwd == NewLoginPwd) { JScript.AlertMsgOne(this, "新密码不能跟老密码一样,请重新输入!", JScript.IconOption.错误); return; } else if (NewLoginPwd == Util.md5("123456")) { JScript.AlertMsgOne(this, "新密码不能设置为系统默认密码,请重新输入!", JScript.IconOption.错误); return; } else { if (new Hi.BLL.SYS_Users().UpdatePassWord(NewLoginPwd, UserID.ToString())) { ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>$(window.parent.leftFrame.document).find('.menuson').css('display','none');</script>"); JScript.AlertMethod(this, "修改成功", JScript.IconOption.正确, "function(){ window.location.href='jsc.aspx'; }"); } } } else { JScript.AlertMsgOne(this, "原始密码错误,请重新输入!", JScript.IconOption.错误); return; } } else { JScript.AlertMsgOne(this, "密码填写不一致!", JScript.IconOption.错误); return; } }
/// <summary> /// 初始化参数 /// </summary> private void initiParams(string Compid) { List <Hi.Model.BD_Company> Comp = new Hi.BLL.BD_Company().GetList("", " isnull(dr,0)=0 and ID=" + Compid + "", ""); if (Comp.Count > 0) { CompID = Comp[0].ID; Erptype = Comp[0].Erptype; List <Hi.Model.SYS_Users> User = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and Type=4 and CompID=" + CompID + "", ""); if (User.Count > 0) { UserID = User[0].ID; } } else { throw new Exception("数据导入失败,查找不到compid:(" + Compid + ")的企业"); } }
protected void btnSubMit_Click(object sender, EventArgs e) { if (ViewState["Userid"] != null) { if (string.IsNullOrWhiteSpace(txt_NewPhone.Value.Trim())) { JScript.AlertMsg(this, "新手机号码不能为空!。"); return; } int Userid = ViewState["Userid"].ToString().ToInt(0); Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(Userid); if (User != null) { User.Phone = Common.NoHTML(txt_NewPhone.Value.Trim()); new Hi.BLL.SYS_Users().Update(User); ClientScript.RegisterStartupScript(this.GetType(), "MSG", "<script>window.parent.location.href=window.parent.location.href; </script>"); } } }
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 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 Page_Load(object sender, EventArgs e) { DataSet ds = new Hi.BLL.BD_DisAddr().GetModel(this.DisID.ToString()); coutn = (ds.Tables[0].Rows.Count + 1).ToString(); rptdelivery.DataSource = ds; rptdelivery.DataBind(); dis = new Hi.BLL.BD_Distributor().GetModel(this.DisID); if (dis != null) { Principal = dis.Principal; Phone = dis.Phone; ID = dis.ID.ToString(); } string phone = new Hi.BLL.SYS_Users().GetModel(this.UserID).Phone; phones = AESHelper.Encrypt_php(phone); userphone = phone.Substring(0, 3) + "*****" + phone.Substring(phone.Length - 4); if (!string.IsNullOrEmpty(Request["type"]) && Request["type"].ToString() == "add") { Add_Addre(); } }