Esempio n. 1
0
 public ActionResult Add(BLL.Link L)
 {
     using (BLL.NETDISKDBEntities Db = new BLL.NETDISKDBEntities())
     {
         try
         {
             var image = Request.Files["FileUpload1"];
             if (image != null && image.ContentLength > 0)
             {
                 string fileName = DateTime.Now.ToString("yyyyMMdd") + "-" + Path.GetFileName(image.FileName);
                 string filePath = Path.Combine(Server.MapPath("~/Content/Img"), fileName);
                 image.SaveAs(filePath);
                 L.img = fileName;
             }
             L.State = 1;
             Db.Link.Add(L);
             int re = Db.SaveChanges();
             if (re > 0)
             {
                 BLL.Log.UserLog.AddUserLog("添加系统成功", GetCookie.GetUserCookie().userName + " 成功创建 " + L.oaName + " 系统 ");
             }
             else
             {
                 BLL.Log.UserLog.AddUserLog("创建系统失败", "数据插入失败!");
             }
         }
         catch (Exception ex)
         {
             BLL.Log.UserLog.AddUserLog("创建系统失败", ex.Message);
             throw;
         }
         return(View("List"));
     }
 }
Esempio n. 2
0
        public ActionResult UserRoleList()
        {
            BLL.Cookie.TeUser U = GetCookie.GetUserCookie();

            ViewBag.Agencylists = AgencyManager.GetAgencyNameList(U.rootCode, "( [SubAgencyTypeID]=1 OR [SubAgencyTypeID]=2 OR [SubAgencyTypeID]=9 )");

            return(View());
        }
Esempio n. 3
0
 public ActionResult Index()
 {
     BLL.Role.UserRoleInfo Role = new BLL.Role.UserRoleInfo();
     ViewBag.IsAdmin = Role.IsAdmin();
     BLL.Cookie.TeUser U = GetCookie.GetUserCookie();
     U.userName = U.userName;
     return(View(U));
 }
Esempio n. 4
0
        public bool IsAdmin()
        {
            UserRoleInfo item = new UserRoleInfo();

            BLL.Cookie.TeUser U = GetCookie.GetUserCookie();
            bool    A           = false;
            DataSet dt          = UserManager.GetUserRoleInfoList("UserCode ='" + U.userCode + "'");

            for (int i = 0; i < dt.Tables[0].Rows.Count; i++)
            {
                if (dt.Tables[0].Rows[i]["RoleCode"].ToString() == "1001")
                {
                    A = true;
                }
            }
            return(A);
        }
Esempio n. 5
0
        //日志添加
        public static int AddUserLog(string LogName, string LogNote)
        {
            BLL.Cookie GetCookie = new BLL.Cookie();
            int        reset     = 0;

            using (NETDISKDBEntities Db = new NETDISKDBEntities())
            {
                BLL.UserLog log = new BLL.UserLog();
                log.LogCreatTime = DateTime.Now;
                log.LogName      = LogName;
                log.LogNote      = LogNote;
                log.UserName     = GetCookie.GetUserCookie().userName;
                log.State        = true;
                Db.UserLog.Add(log);
                reset = Db.SaveChanges();
            }
            return(reset);
        }
Esempio n. 6
0
 // GET: /Manage/
 public ActionResult Index()
 {
     BLL.Cookie.TeUser U = new BLL.Cookie.TeUser();
     U = GetCookie.GetUserCookie();
     return(View(U));
 }
Esempio n. 7
0
        //
        // GET: /Electronic/
        public ActionResult Usage()
        {
            ViewBag.User = GetCookie.GetUserCookie();

            return(View());
        }