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