Esempio n. 1
0
 public static bool Login(UsersModel user, string remName)
 {
     if (IsLogin)
         CookieHelper.RemoveCookie("EquipmentMonitor", "EquipmentMonitorLogin");
     CookieHelper.AddCookie("EquipmentMonitor", "EquipmentMonitorLogin", user.ToJsonString(), DateTime.Now.AddMonths(1));
     if (remName == "checked")
     {
         if (CookieHelper.GetCookie("remName") == null || CookieHelper.GetCookieValue("remName").IsNullOrEmpty())
         {
             CookieHelper.SetCookie("remName", "", user.UserName, DateTime.Now.AddYears(1));
         }
     }
     return true;
 }
        public ActionResult detail(int id)
        {
            UsersDAL dal = new UsersDAL();
            JurisdictionDAL jdal = new JurisdictionDAL();
            IList<JurisdictionModel> list = null;
            UsersModel users = null;
            try
            {
                users = dal.QuerySingle(" id=" + id);
                list = jdal.QuerySQL(" id!=5", " Sort");
            }
            catch (Exception ex)
            {
                Log.Default.Error(ex);
            }
            if (users == null)
                users = new UsersModel();
            ViewBag.users = users;

            if (list == null)
                list = new List<JurisdictionModel>();
            ViewBag.list = list;
            return View();
        }