/// <summary> /// 用户审核不通过 /// </summary> public void GTPAuditcancel() { BllSysMaster Bll = new BllSysMaster(); string Introduction = Request["Introduction"].ToString(); var msg = new ModJsonResult(); string key = Request["id"]; var model = Bll.LoadData(key); int result = Bll.Delete(key); if (result > 0) { msg.success = true; //发送短信 WebService.SDKService msm = new WebService.SDKService(); string sn = ConfigurationManager.AppSettings["sn"]; string pwd = ConfigurationManager.AppSettings["pwd"]; string smstext = "您在电梯宝申请的账户信息审核没有通过,原因:【" + Introduction + "】,请麻烦您尽快重新申请.为您审批通过."; result = msm.sendSMS(sn.Trim().ToString(), pwd.Trim().ToString(), "", model.LoginName.Split(new char[] { ',' }), smstext, "", "GBK", 3, Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmssfff"))); } else { msg.success = false; msg.msg = "操作失败"; } WriteJsonToPage(msg.ToString()); }
/// <summary> /// 用户审核通过 /// </summary> public void GTPAudit() { BllSysMaster Bll = new BllSysMaster(); var msg = new ModJsonResult(); string key = Request["id"]; var model = Bll.LoadData(key); int result = Bll.UpdateStatus(1, key); if (result > 0) { msg.success = true; //发送短信 WebService.SDKService msm = new WebService.SDKService(); string sn = ConfigurationManager.AppSettings["sn"]; string pwd = ConfigurationManager.AppSettings["pwd"]; string smstext = "亲,恭喜您,您在电梯宝申请的账户信息审核已通过,第一次使用,系统赠送您【" + model.Money.ToString("#0.00") + "】元保证金,赶紧登录电梯宝,体验一下吧."; result = msm.sendSMS(sn.Trim().ToString(), pwd.Trim().ToString(), "", model.LoginName.Split(new char[] { ',' }), smstext, "", "GBK", 3, Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmssfff"))); } else { msg.success = false; msg.msg = "操作失败"; } WriteJsonToPage(msg.ToString()); }
/// <summary> /// 删除 /// </summary> public void DeleteData(string id) { var msg = new ModJsonResult(); try { //判断类型是否还在使用 var mode = new BllSysAppointed().Exists(" ResponsibleId='" + id + "'"); if (mode == true) { msg.success = false; msg.msg = "该用户下还存在管理的设备,请先更改设备责任人再删除."; } else { BllSysMaster Master = new BllSysMaster(); var Model = Master.LoadData(id); if (Model != null) { Model.Status = (int)StatusEnum.除; int result = Master.Update(Model); if (result > 0) { msg.success = true; } else { msg.success = false; msg.msg = "操作失败"; } } } } catch (Exception ex) { msg.msg = "操作失败:" + ex.Message; } WriteJsonToPage(msg.ToString()); }
/// <summary> /// 查看他人权限设置 /// </summary> public void GetOtherfunTree() { if (CurrentMaster != null) { string _typeId = Request["TypeID"]; _key = Request["key"]; string output; DataTable mytab = null; BllSysMaster mybase = new BllSysMaster(); //查询角色创建人 BllSysRole role = new BllSysRole(); var roleInfo = role.LoadData(_key); var other = mybase.LoadData(roleInfo.CreaterId); //角色用户 if (other.Attribute != (int)AdminTypeEnum.普通员工) //超级管理员,不用控权 { _where += " and TypeID=" + _typeId + " and Status=" + (int)StatusEnum.正常; mytab = new BllSysFun().GetTreeList(_where).Tables[0]; //获取所有树 } else { string roleIdList = new BllSysMasterRole().GetMasterRole(other.Id); if (!String.IsNullOrEmpty(roleIdList)) { _where += " and TypeID=" + _typeId + "and Status=" + (int)StatusEnum.正常; mytab = mybase.GetAuthByPage(roleIdList, _where).Tables[0]; } else { WriteJsonToPage(Output); return; } } GetTreeNode(mytab);//功能权限 } Output = Output.Replace("check", "checked"); WriteJsonToPage(Output); }
public void SaveData(ModSysCompany mod) { try { ModSysMaster master = new ModSysMaster(); #region ===获取管理员信息 string UserName = Request.Params["UserName"]; string LoginName = Request.Params["LoginName"]; string Pwd = Request.Params["Pwd"]; string UserEmail = Request.Params["UserEmail"]; string UserPhone = Request.Params["UserPhone"]; Pwd = (string.IsNullOrEmpty(Pwd) ? DESEncrypt.Encrypt("666666") : DESEncrypt.Encrypt(Pwd)); #endregion mod.CompLat = (mod.CompLat == null ? "" : mod.CompLat); mod.ComPLon = (mod.ComPLon == null ? "" : mod.ComPLon); int result = 0; if (!string.IsNullOrEmpty(Request["modify"])) //修改 { ModSysCompany model = bll.LoadData(mod.Id); model.Name = mod.Name; //公司名称 model.LegalPerson = mod.LegalPerson; model.LinkUser = mod.LinkUser; //联系人 model.Address = mod.Address; //公司地址 model.Code = mod.Code; model.ReegistMoney = mod.ReegistMoney; //注册资金 model.Phone = mod.Phone; //公司电话 model.Email = mod.Email; //邮箱 model.Introduction = mod.Introduction; //公司介绍 model.CompLat = mod.CompLat; model.ComPLon = mod.ComPLon; model.Nature = mod.Nature; //公司分类 model.Type = mod.Type; //公司性质 model.LegalPerson = mod.LegalPerson; //法人 model.Pact = mod.Pact; //合同 model.LicenseNumber = mod.LicenseNumber; model.Province = mod.Province; model.CityId = mod.CityId; model.AreaId = mod.AreaId; result = bll.Update(model); if (result <= 0) { json.success = false; json.msg = "修改失败,请稍后再操作!"; } else { BllSysMaster newMaster = new BllSysMaster(); master = newMaster.LoadData(Request.Params["UID"]); master.UserName = UserName; master.LoginName = LoginName; master.Email = UserEmail; master.Phone = UserPhone; master.Id = Request.Params["UID"]; master.Pwd = Pwd; newMaster.Update(master); } } else { mod.Id = Guid.NewGuid().ToString(); master.Pwd = Pwd; master.Id = Guid.NewGuid().ToString(); master.Status = (int)StatusEnum.正常; master.IsMain = true; master.Cid = mod.Id; master.IsSystem = true; master.CreaterId = CurrentMaster.Id; master.UserName = UserName; master.LoginName = LoginName; master.Email = UserEmail; master.Phone = UserPhone; master.OrganizaId = "0"; master.Attribute = (int)AdminTypeEnum.供应商管理员; new BllSysMaster().ClearCache(); result = new BllSysMaster().Insert(master); if (result > 0) { mod.Attribute = (int)CompanyType.供应商; mod.CreateCompanyId = CurrentMaster.Cid; mod.CreateTime = DateTime.Now; mod.CreaterUserId = CurrentMaster.Id; mod.Status = (int)StatusEnum.正常; mod.Path = "1," + CurrentMaster.Company.CreateCompanyId + "," + CurrentMaster.Cid; mod.ProPic = "/UploadFile/CompanyProPic/default_img_company.png"; mod.MasterId = master.Id; result = bll.Insert(mod); if (result <= 0) { new BllSysMaster().Delete(master.Id); } } if (result <= 0) { json.success = false; json.msg = " 保存失败,请稍后再操作!"; } } } catch (Exception) { json.msg = "保存失败!"; json.success = false; } WriteJsonToPage(json.ToString()); }
public void SaveData(ModSysMaster t) { BllSysMaster bll = new BllSysMaster(); ModJsonResult json = new ModJsonResult(); string HPact = Request["HPact"] == null ? "" : Request["HPact"];//用户上传头像 t.Pwd = (string.IsNullOrEmpty(t.Pwd) ? DESEncrypt.Encrypt("666666") : DESEncrypt.Encrypt(t.Pwd.Trim())); t.LoginName = t.LoginName.Trim(); t.UserName = t.UserName.Trim(); if (!string.IsNullOrEmpty(Request["modify"])) //修改 { t.HeadImg = HPact; var model = bll.LoadData(t.Id); model.Pwd = t.Pwd; model.LoginName = t.LoginName; model.UserName = t.UserName; model.HeadImg = HPact; int result = bll.UpdateDate(t); if (result <= 0) { json.success = false; json.msg = "修改失败,请稍后再操作!"; } } else { string OrganizaId = Request["OrganizaId"].ToString();//部门编号 //根据部门编号查询单位信息 var company = new BllSysCompany().LoadData(OrganizaId); if (company.Attribute == (int)CompanyType.单位 || company.Attribute == (int)CompanyType.部门) { t.Attribute = (int)AdminTypeEnum.单位用户;//用户类型 } else if (company.Attribute == (int)CompanyType.供应商) { t.Attribute = (int)AdminTypeEnum.供应商用户; } else if (company.Attribute == (int)CompanyType.维保公司) { t.Attribute = (int)AdminTypeEnum.维保用户; } else if (company.Attribute == (int)CompanyType.消防部门) { t.Attribute = (int)AdminTypeEnum.消防用户; } t.Id = Guid.NewGuid().ToString(); t.Status = (int)StatusEnum.正常; t.Cid = company.CreateCompanyId; t.OrganizaId = OrganizaId;//部门编号 t.IsSystem = false; t.CreaterId = CurrentMaster.Id; t.CreateTime = DateTime.Now; t.HeadImg = HPact; t.IsMain = true; //t.Money = 1000; //DataSet ds = new BllSysHatProvince().GetArea(CurrentMaster.Cid); //if (ds.Tables[0].Rows.Count > 0) //{ // t.Detail = ds.Tables[0].Rows[0]["ProvinceName"].ToString() + " " + ds.Tables[0].Rows[0]["CityName"].ToString() + " " + ds.Tables[0].Rows[0]["AreaName"].ToString(); //} t.CardNum = t.OperateNum; int result = bll.Insert(t); if (result <= 0) { json.success = false; json.msg = " 保存失败,请稍后再操作!"; } new BllSysMaster().ClearCache(); } WriteJsonToPage(json.ToString()); }
public void SaveData(ModSysCompany t) { ModJsonResult json = new ModJsonResult(); ModSysMaster master = new ModSysMaster(); #region ===获取管理员信息 string UserName = Request.Params["UserName"]; string LoginName = Request.Params["LoginName"]; string Pwd = Request.Params["Pwd"]; string UserEmail = Request.Params["UserEmail"]; string UserPhone = Request.Params["UserPhone"]; Pwd = (string.IsNullOrEmpty(Pwd) ? DESEncrypt.Encrypt("666666") : DESEncrypt.Encrypt(Pwd)); #endregion t.LinkUser = (t.LinkUser == null ? "" : t.LinkUser); t.LegalPerson = (t.LegalPerson == null ? "" : t.LegalPerson); t.CompLat = (t.CompLat == null ? "" : t.CompLat); t.ComPLon = (t.ComPLon == null ? "" : t.ComPLon); string x = Request.Params["x"]; string y = Request.Params["y"]; if (!string.IsNullOrEmpty(Request["modify"])) //修改 { ModSysCompany model = bll.LoadData(t.Id); model.Name = t.Name; model.LegalPerson = t.LegalPerson; model.LinkUser = t.LinkUser; model.Address = t.Address; model.CompLat = t.CompLat; model.ComPLon = t.ComPLon; model.Code = t.Code; model.ReegistMoney = t.ReegistMoney; model.Phone = t.Phone; model.Email = t.Email; model.Introduction = t.Introduction; model.LawyerPhone = t.LawyerPhone; model.LawyerName = t.LawyerName; model.CompLat = t.CompLat; model.ComPLon = t.ComPLon; model.Province = t.Province; model.CityId = t.CityId; model.AreaId = t.AreaId; model.Nature = t.Nature; //公司分类 model.Type = t.Type; //公司性质 model.RegisiTime = t.RegisiTime; int result = bll.Update(model); if (result <= 0) { json.success = false; json.msg = "修改失败,请稍后再操作!"; } else { BllSysMaster newMaster = new BllSysMaster(); master = newMaster.LoadData(Request.Params["UID"]); master.UserName = UserName; master.Pwd = Pwd; master.LoginName = LoginName; master.Email = UserEmail; master.Phone = UserPhone; master.Id = Request.Params["UID"]; newMaster.Update(master); } } else { t.Id = Guid.NewGuid().ToString(); master.Id = Guid.NewGuid().ToString(); master.Status = (int)StatusEnum.正常; master.IsMain = true; master.Cid = t.Id; master.IsSystem = true; master.Pwd = Pwd; master.CreaterId = CurrentMaster.Id; master.UserName = UserName; master.LoginName = LoginName; master.Email = UserEmail; master.Phone = UserPhone; master.OrganizaId = "0"; master.Attribute = (int)AdminTypeEnum.单位管理员; new BllSysMaster().ClearCache(); int result = new BllSysMaster().Insert(master); if (result <= 0) { json.success = false; json.msg = " 保存失败,请稍后再操作!"; } else { t.Status = (int)StatusEnum.正常; t.CreaterUserId = CurrentMaster.Id; t.CreateTime = DateTime.Now; t.Attribute = (int)CompanyType.单位; t.Path = "1," + CurrentMaster.Cid; t.ProPic = "/UploadFile/CompanyProPic/default_img_company.png"; t.MasterId = master.Id; t.CreateCompanyId = "0"; t.RegisiTime = DateTime.Now;//公司注册时间 result = bll.Insert(t); if (result <= 0) { new BllSysMaster().Delete(master.Id); } } } WriteJsonToPage(json.ToString()); }