Ejemplo n.º 1
0
        internal static void Add(SpareEntities db, TB_INVENTORY_LOC bill, string operName, OperateType operateType)
        {
            var log = new TL_BILL()
            {
                OperName = operName,
                LogTime  = DateTime.Now,
                BillNum  = bill.BillNum,
                BillType = (int)BillType.InventoryPlan,
                LogType  = operateType.ToString(),
            };

            db.TL_BILL.Add(log);
        }
Ejemplo n.º 2
0
        public static void Add(SpareEntities db, TB_BILL bill, string operName, OperateType operateType)
        {
            var log = new TL_BILL()
            {
                OperName = operName,
                LogTime  = DateTime.Now,
                BillNum  = bill.BillNum,
                BillType = bill.BillType,
                LogType  = operateType.ToString(),
            };

            db.TL_BILL.Add(log);
        }
Ejemplo n.º 3
0
        public static TL_BASEDATA Add(SpareEntities db, string dataType, string oldValue, string newValue, string operName, OperateType operateType)
        {
            var log = new TL_BASEDATA
            {
                OperName = operName,
                LogTime  = DateTime.Now,
                LogType  = operateType.ToString(),
                DataType = dataType,
                OldValue = oldValue,
                NewValue = newValue,
            };

            db.TL_BASEDATA.Add(log);
            return(log);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 记录日志到数据库
 /// </summary>
 /// <param name="strTxt">内容</param>
 public void WriteLogToDB(string strTxt, OperateType Otp, string Ip)
 {
     try
     {
         using (wxEntities context = new wxEntities())
         {
             T_logs _log = context.T_logs.Create();
             _log.LogId          = Guid.NewGuid().ToString("N");
             _log.OperateContent = strTxt;
             _log.CreateTime     = DateTime.Now;
             _log.OperateType    = Otp.ToString();
             _log.UserIP         = Ip;
             context.T_logs.Add(_log);
             context.SaveChanges();
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 5
0
 bool CheckOperateType(string op, OperateType opType)
 {
     return(string.Equals(op, opType.ToString(), StringComparison.CurrentCultureIgnoreCase));
 }
Ejemplo n.º 6
0
        public static string Operate(OperateTable operationName, OperateType operate, object body)
        {
            OperateBody op = new OperateBody(operationName.ToString(), operate.ToString(), body);

            return(JsonHelper.JsonSerilize(op));
        }