public string Add(Enterprise Model) { Model.Addtime = DateTime.Now; Model.EIMG = Model.EIMG.TrimEnd("_1".ToCharArray()); EnterpriseBll bll = new EnterpriseBll(); return(bll.Add(Model)); }
// GET: EnterpriseLock public ActionResult Index() { EnterpriseBll bll=new EnterpriseBll(); Enterprise model = bll.GetModelById(LoginUser.UserBasic.EnterpriseID); return View(model); }
// GET: EnterpriseLock public ActionResult Index() { EnterpriseBll bll = new EnterpriseBll(); Enterprise model = bll.GetModelById(LoginUser.UserBasic.EnterpriseID); return(View(model)); }
public string Add(Enterprise Model) { Model.Addtime = DateTime.Now; Model.EIMG = Model.EIMG.TrimEnd("_1".ToCharArray()); EnterpriseBll bll = new EnterpriseBll(); return bll.Add(Model); }
public static string _host = ".kerlaii.com";//从数据库动态获取 public void OnActionExecuting(ActionExecutingContext filterContext) { bool isajax = filterContext.HttpContext.Request.IsAjaxRequest(); UserPC user = filterContext.HttpContext.Session["user"] as UserPC; string host = filterContext.HttpContext.Request.Url.Host; string key = host.Replace(_host, ""); //本地调试,模拟e0001企业 opera if (host.ToLower() == "localhost") { key = "e0001"; } EnterpriseBll bll = new EnterpriseBll(); string[] keys = bll.GetAllEnteriseKey(); if (key != "opera" && !keys.Contains(key)) { filterContext.Result = new HttpNotFoundResult(); return; //没有该企业 } filterContext.HttpContext.Session["enterpriseKey"] = key; if (check) { if (user == null) { ReturnData <string> ret = new ReturnData <string>(); if (isajax) { ret.Status = false; Dictionary <string, object> Identify = new Dictionary <string, object>(); Identify.Add("expired", true); ret.Identify = Identify; filterContext.Result = new ContentResult() { Content = ret.GetJson() }; return; } //跳转页面 filterContext.Result = new ContentResult() { Content = "<script>window.top.location.href ='/';</script>" }; return; } LogAdapter.Write(user.UserBasic.EnterpriseID + " " + key, LogAdapter.LogMode.ERROR); //当前用户不是当前企业 if (user.UserBasic.EnterpriseID != key) { filterContext.HttpContext.Response.Redirect("/Login"); } } }
public static string _host = ".kerlaii.com";//从数据库动态获取 public void OnActionExecuting(ActionExecutingContext filterContext) { bool isajax = filterContext.HttpContext.Request.IsAjaxRequest(); UserPC user = filterContext.HttpContext.Session["user"] as UserPC; string host = filterContext.HttpContext.Request.Url.Host; string key = host.Replace(_host, ""); //本地调试,模拟e0001企业 opera if (host.ToLower() == "localhost") { key = "e0001"; } EnterpriseBll bll = new EnterpriseBll(); string[] keys = bll.GetAllEnteriseKey(); if (key !="opera" && !keys.Contains(key)) { filterContext.Result = new HttpNotFoundResult(); return; //没有该企业 } filterContext.HttpContext.Session["enterpriseKey"] = key; if (check) { if (user == null) { ReturnData<string> ret = new ReturnData<string>(); if (isajax) { ret.Status = false; Dictionary<string, object> Identify = new Dictionary<string, object>(); Identify.Add("expired", true); ret.Identify = Identify; filterContext.Result = new ContentResult() { Content = ret.GetJson() }; return; } //跳转页面 filterContext.Result = new ContentResult() { Content = "<script>window.top.location.href ='/';</script>" }; return ; } LogAdapter.Write(user.UserBasic.EnterpriseID+" "+key, LogAdapter.LogMode.ERROR); //当前用户不是当前企业 if (user.UserBasic.EnterpriseID != key) { filterContext.HttpContext.Response.Redirect("/Login"); } } }
public ActionResult Index() { var model = new UserPC(); if (Request.Cookies["remember"] != null) { if (Request.Cookies["remember"]["uname"] != "") { model.UserName = Request.Cookies["remember"]["uname"]; model.PassWord = "******"; } } //获取企业信息 用来显示logo等信息 EnterpriseBll objEnterpriseBll = new EnterpriseBll(); var enterprise = objEnterpriseBll.GetObjectById(o => o.ID == EnterpriseKey); if (enterprise == null) return HttpNotFound(); ViewBag.Enterprise = enterprise; return View(model); }
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 Index() { var model = new UserPC(); if (Request.Cookies["remember"] != null) { if (Request.Cookies["remember"]["uname"] != "") { model.UserName = Request.Cookies["remember"]["uname"]; model.PassWord = "******"; } } //获取企业信息 用来显示logo等信息 EnterpriseBll objEnterpriseBll = new EnterpriseBll(); var enterprise = objEnterpriseBll.GetObjectById(o => o.ID == EnterpriseKey); if (enterprise == null) { return(HttpNotFound()); } ViewBag.Enterprise = enterprise; return(View(model)); }
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); }