public ActionResult FirstLogin(string name, string pwd, string num) { ReturnData <string> ret = new ReturnData <string>(); AgentBll aBll = new AgentBll(); UserBasicBll uBll = new UserBasicBll(); UserPCBll pcBll = new UserPCBll(); Agent aModel = aBll.GetModelByPhone(num); UserBasic uModel = new UserBasic(); UserPC pcModel = new UserPC(); uModel.NickName = name; uModel.UserType = 1; uModel.EnterpriseID = aModel.EnterpriseID; uModel.AddTime = DateTime.Now; long id = uBll.AddAndGetId(uModel); pcModel.UserBasicID = id; pcModel.PassWord = SimpleEncrypt.SaltMD5(pwd.Replace(" ", "")); pcModel.PCType = 2; pcModel.RoleID = aModel.ID; pcModel.Status = 0; pcModel.UserName = name; pcModel.AddTime = DateTime.Now; pcModel.AddUserBasicID = 0; ret = pcBll.AddUserPc(pcModel); if (ret.Status == true) { aModel.Status = 0; aBll.EditAgent(aModel); return(Content(ret.Message)); } return(Content(ret.Message)); }
public ActionResult CheckNum(string num) { AgentBll bll = new AgentBll(); EnterpriseBll eBll = new EnterpriseBll(); Agent model = bll.GetModelByPhone(num); Enterprise emodel = eBll.GetModelById(model.EnterpriseID); if (model == null) { return(Content("您所输入的手机号码不存在!请确认号码!")); } if (model.Status != 1) { return(Content("您所输入的手机号码不是待验证状态!请确认号码!")); } ISMS test = new Sms(); string checkNum = test.SendbyGSM(num, emodel.EName); return(Content(checkNum)); }
public ActionResult CheckNum(string num) { AgentBll bll = new AgentBll(); EnterpriseBll eBll = new EnterpriseBll(); Agent model = bll.GetModelByPhone(num); Enterprise emodel = eBll.GetModelById(model.EnterpriseID); if (model == null) { return Content("您所输入的手机号码不存在!请确认号码!"); } if (model.Status != 1) { return Content("您所输入的手机号码不是待验证状态!请确认号码!"); } ISMS test = new Sms(); string checkNum = test.SendbyGSM(num, emodel.EName); return Content(checkNum); }
public ActionResult FirstLogin(string name, string pwd, string num) { ReturnData<string> ret = new ReturnData<string>(); AgentBll aBll = new AgentBll(); UserBasicBll uBll = new UserBasicBll(); UserPCBll pcBll = new UserPCBll(); Agent aModel = aBll.GetModelByPhone(num); UserBasic uModel = new UserBasic(); UserPC pcModel = new UserPC(); uModel.NickName = name; uModel.UserType = 1; uModel.EnterpriseID = aModel.EnterpriseID; uModel.AddTime = DateTime.Now; long id = uBll.AddAndGetId(uModel); pcModel.UserBasicID = id; pcModel.PassWord = SimpleEncrypt.SaltMD5(pwd.Replace(" ", "")); pcModel.PCType = 2; pcModel.RoleID = aModel.ID; pcModel.Status = 0; pcModel.UserName = name; pcModel.AddTime = DateTime.Now; pcModel.AddUserBasicID = 0; ret = pcBll.AddUserPc(pcModel); if (ret.Status == true) { aModel.Status = 0; aBll.EditAgent(aModel); return Content(ret.Message); } return Content(ret.Message); }