Example #1
0
 public ActionResult SubmitForm(Sys_Items itemsEntity, string keyValue)
 {
     try
     {
         bool i = false;
         if (keyValue == "" || keyValue == null)
         {
             itemsEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserCode;
             itemsEntity.F_CreatorTime   = DateTime.Now;
             itemsEntity.F_Id            = System.Guid.NewGuid().ToString();
             string[] notstr = { "ChildNodes" };
             i = itemsApp.Add(itemsEntity, notstr);
         }
         else
         {
             itemsEntity.F_Id = keyValue;
             itemsEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserCode;
             itemsEntity.F_LastModifyTime   = DateTime.Now;
             string[] notstr = { "ChildNodes", "F_CreatorUserId", "F_CreatorTime", "F_ParentId" };
             i = itemsApp.Update(itemsEntity, notstr);
         }
         if (i)
         {
             return(Success());
         }
         else
         {
             return(Warning());
         }
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
Example #2
0
 public ActionResult SubmitForm(Sys_ItemsModel itemsEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         itemsEntity.F_Id = keyValue;
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             itemsEntity.F_LastModifyUserId = LoginInfo.UserId;
         }
         itemsEntity.F_LastModifyTime = DateTime.Now;
         ibll.Update(itemsEntity);
     }
     else
     {
         itemsEntity.F_Id = Common.GuId();
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             itemsEntity.F_CreatorUserId = LoginInfo.UserId;
         }
         itemsEntity.F_CreatorTime = DateTime.Now;
         ibll.Add(itemsEntity);
     }
     return(Success("操作成功。"));
 }