示例#1
0
        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);
        }
示例#3
0
        // GET: EnterpriseLock
        public ActionResult Index()
        {
            EnterpriseBll bll = new EnterpriseBll();

            Enterprise model = bll.GetModelById(LoginUser.UserBasic.EnterpriseID);

            return(View(model));
        }
示例#4
0
        public string Add(Enterprise Model)
        {
            Model.Addtime = DateTime.Now;
            Model.EIMG = Model.EIMG.TrimEnd("_1".ToCharArray());
            EnterpriseBll bll = new EnterpriseBll();

            return bll.Add(Model);
        }
示例#5
0
        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");
                }
            }
        }
示例#6
0
        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");
                }

            }

        }
示例#7
0
 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);
 }
示例#8
0
        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));
        }
示例#9
0
        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));
        }
示例#10
0
        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);
        }