public void SubmitForm(ItemsDetailEntity itemsDetailEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         itemsDetailEntity.Modify(keyValue);
         service.Update(itemsDetailEntity);
     }
     else
     {
         itemsDetailEntity.Create();
         service.Insert(itemsDetailEntity);
     }
 }
Example #2
0
        public void SubmitForm(Sys_ItemsDetail itemsDetailEntity, string keyValue)
        {
            OperatorModel op = OperatorProvider.Provider.GetCurrent();

            if (!string.IsNullOrEmpty(keyValue))
            {
                //itemsDetailEntity.Modify(keyValue);
                itemsDetailEntity.F_Id               = keyValue;
                itemsDetailEntity.F_LastModifyTime   = DateTime.Now;
                itemsDetailEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserId;
                itemsDetailEntity.F_DeleteMark       = false;
                service.Update(itemsDetailEntity);
                LogHelper.Info("字典:【" + itemsDetailEntity.F_ItemName + "】编辑!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), OpType.System, null, "", "", ViewLevel.Admin);
            }
            else
            {
                //itemsDetailEntity.Create();
                itemsDetailEntity.F_Id            = Common.GuId();
                itemsDetailEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserId;
                itemsDetailEntity.F_CreatorTime   = DateTime.Now;
                itemsDetailEntity.F_DeleteMark    = false;
                service.Insert(itemsDetailEntity);
                LogHelper.Info("字典:【" + itemsDetailEntity.F_ItemName + "】新增!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), OpType.System, null, "", "", ViewLevel.Admin);
            }
        }
Example #3
0
 public void SubmitForm(ItemsDetailEntity itemsDetailEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         itemsDetailEntity.Modify(keyValue);
         service.Update(itemsDetailEntity);
         try
         {
             //添加日志
             LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "修改数据字典信息【" + itemsDetailEntity.F_ItemName + "】成功!");
         }
         catch { }
     }
     else
     {
         itemsDetailEntity.Create();
         service.Insert(itemsDetailEntity);
         try
         {
             //添加日志
             LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "新建数据字典信息【" + itemsDetailEntity.F_ItemName + "】成功!");
         }
         catch { }
     }
 }
Example #4
0
 public void SubmitForm(Sys_ItemsDetail entity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.F_Id = keyValue;
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             entity.F_LastModifyUserId = LoginInfo.UserId;
         }
         entity.F_LastModifyTime = DateTime.Now;
         service.Update(entity);
     }
     else
     {
         entity.F_Id = Common.GuId();
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             entity.F_CreatorUserId = LoginInfo.UserId;
         }
         entity.F_CreatorTime = DateTime.Now;
         service.Insert(entity);
     }
 }
Example #5
0
 public override object Insert(Sys_ItemsDetail model)
 {
     model.Id         = Guid.NewGuid().ToString();
     model.IsEnabled  = model.IsEnabled == null ? false : true;
     model.IsDefault  = model.IsDefault == null ? false : true;
     model.DeleteMark = false;
     model.CreateUser = OperatorProvider.Instance.Current.Account;
     model.CreateTime = DateTime.Now;
     model.ModifyUser = model.CreateUser;
     model.ModifyTime = model.CreateTime;
     return(_itemsDetailRepository.Insert(model));
 }
Example #6
0
 public void SubmitForm(ItemsDetailEntity itemsDetailEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         itemsDetailEntity.Modify(keyValue);
         service.Update(itemsDetailEntity);
         //添加日志
         LogHelp.logHelp.WriteDbLog(true, "修改字典内容信息=>" + itemsDetailEntity.ItemName, Enums.DbLogType.Update, "字典内容管理");
     }
     else
     {
         itemsDetailEntity.Create();
         service.Insert(itemsDetailEntity);
         //添加日志
         LogHelp.logHelp.WriteDbLog(true, "添加字典内容信息=>" + itemsDetailEntity.ItemName, Enums.DbLogType.Create, "字典内容管理");
     }
 }
Example #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="itemsDetailEntity"></param>
 /// <param name="keyValue"></param>
 public void SubmitForm(ItemsDetailEntity itemsDetailEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         itemsDetailEntity.Modify(keyValue);
         ResultClass <int> _ret = service.Update(itemsDetailEntity);
         if (!_ret.Result)
         {
             throw new Exception(_ret.ErrorMessage);
         }
     }
     else
     {
         itemsDetailEntity.Create();
         ResultClass <int> _ret = service.Insert(itemsDetailEntity);
         if (!_ret.Result)
         {
             throw new Exception(_ret.ErrorMessage);
         }
     }
 }