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); }
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); }
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); }
/// <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 { } }
bool CheckOperateType(string op, OperateType opType) { return(string.Equals(op, opType.ToString(), StringComparison.CurrentCultureIgnoreCase)); }
public static string Operate(OperateTable operationName, OperateType operate, object body) { OperateBody op = new OperateBody(operationName.ToString(), operate.ToString(), body); return(JsonHelper.JsonSerilize(op)); }