Ejemplo n.º 1
0
 public static void AddLog(OUContext db, string person, int id, string logClass, string logAction, string info)
 {
     AccessLog a = new AccessLog();
     a.KeyId = id;
     a.AccessClass = logClass;
     a.AccessAction = logAction;
     a.AccessInfo = info;
     a.AccessTime = DateTime.Now;
     a.AccessPerson = person;
     db.AccessLogs.Add(a);
 }
Ejemplo n.º 2
0
 public static void AddLog(Context db, string person, string code, string logClass, string logAction, string info)
 {
     AccessLog a = new AccessLog();
     a.Code = code;
     a.AccessClass = logClass;
     a.AccessAction = logAction;
     a.AccessInfo = info;
     a.AccessTime = DateTime.Now;
     a.AccessPerson = person;
     db.AccessLogs.Add(a);
 }
Ejemplo n.º 3
0
 public ActionResult PackingAction(int id, int actionName, FormCollection collection)
 {
     if (!UserInfo.CurUser.HasRight("业务管理-PackingList&Invoice")) return Redirect("~/content/AccessDeny.htm");
     AccessLog log = new AccessLog();
     PackingListState state = (PackingListState)actionName;
     TryUpdateModel(log, "", new string[] { "AccessTime" }, new string[] { }, collection);
     //DateTime d;
     //if(DateTime.TryParse(collection["AccessTime"], out d)==false)
     //{
     //    ModelState.AddModelError("AccessTime","Must be a Date");
     //}
     if (ModelState.IsValid)
     {
         log.AccessClass = PackingList.LogClass;
         log.AccessInfo = "";
         log.AccessAction = state.ToString();
         log.KeyId = id;
         db.AccessLogs.Add(log);
         db.SaveChanges();
         PackingList packing = db.PackingLists.Find(id);
         packing.SetState(db);
         db.SaveChanges();
         return Redirect("~/content/close.htm");
     }
     return View(log);
 }
Ejemplo n.º 4
0
        public ActionResult TaxRefundAction(int id, int actionName, FormCollection collection)
        {
            if (!UserInfo.CurUser.HasRight("业务管理-退税操作")) return Redirect("~/content/AccessDeny.htm");
            AccessLog log = new AccessLog();
            TaxRefundState state = (TaxRefundState)actionName;
            TryUpdateModel(log, "", new string[] { "AccessTime" }, new string[] { }, collection);

            if (ModelState.IsValid)
            {
                log.AccessClass = PackingList.LogClass;
                log.AccessInfo = "";
                log.AccessAction = state.ToString();
                log.KeyId = id;
                db.AccessLogs.Add(log);
                db.SaveChanges();
                PackingList packing = db.PackingLists.Find(id);
                packing.SetState(db);
                db.SaveChanges();
                return Redirect("~/content/close.htm");
            }
            return View(log);
        }