示例#1
0
        public static async Task UpdateUserAsync()
        {
            Task  UserUpdate = Task.Run(() => UserTable.UpdateUser(CommandUpdateModel.UserUpdate(UserSettings.BackgroundString, UserSettings.PrimaryColor, UserSettings.SecondaryColor, UserSettings.UseDarkTheme.ToString())));
            await UserUpdate;

            UserSettings.SettingsRefresh();
        }
        public ActionResult UpdateCommand(int id, CommandUpdateModel commandUpdateModel)
        {
            if (!_service.Update(id, commandUpdateModel))
            {
                return(NotFound());
            }

            return(NoContent());
        }
示例#3
0
        public bool Update(int id, CommandUpdateModel commandUpdateModel)
        {
            if (!_dataAccessLayer.LookupCommand(id, out var foundCommand))
            {
                return(false);
            }

            _mapper.Map(commandUpdateModel, foundCommand);
            _dataAccessLayer.Update(foundCommand);
            _dataAccessLayer.Save();

            return(true);
        }
示例#4
0
        public IActionResult Update(string commandId)
        {
            var p     = CommandDal.Find(commandId);
            var model = new CommandUpdateModel()
            {
                CommandId   = p.CommandId,
                FunctionId  = p.FunctionId,
                Href        = p.Href,
                Class       = p.Class,
                IconCls     = p.IconCls,
                Plain       = p.Plain,
                OnClick     = p.OnClick,
                CommandName = p.CommandName,
                Index       = p.Index,
                Location    = p.Location,
            };

            return(View(model));
        }
示例#5
0
 public IActionResult Update(CommandUpdateModel model)
 {
     try
     {
         var p = CommandDal.Find(model.CommandId);
         p.FunctionId  = model.FunctionId;
         p.Href        = model.Href;
         p.Class       = model.Class;
         p.IconCls     = model.IconCls;
         p.Plain       = model.Plain;
         p.OnClick     = model.OnClick;
         p.CommandName = model.CommandName;
         p.Index       = model.Index;
         p.Location    = model.Location;
         CommandDal.Update(p);
         return(Json(1));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message));
     }
 }
示例#6
0
        /// <summary>
        /// Updates the Associated Diary and adds a Record to the Certified Package Table
        /// </summary>
        /// <param name="DiaryID"></param>
        /// <param name="UDNumber"></param>
        /// <param name="FilePath"></param>
        /// <param name="MembersEdipi"></param>
        /// <param name="MembersFirstName"></param>
        /// <param name="MembersLastName"></param>
        /// <param name="MembersMI"></param>
        /// <returns></returns>
        public static async Task UpdateCertifiedPackageAsync(int DiaryID, string UDNumber, string FilePath, int MembersEdipi, string MembersFirstName, string MembersLastName, string MembersMI)
        {
            string        fileName               = UDNumber + '.' + MembersEdipi + ".pdf";
            Task <string> SaveFile               = Task.Run(() => FileOperation.CopyFile(fileName, "Certified Package", FilePath));
            string        FileSaveLocation       = await SaveFile;
            Task          UpdateDiaryTable       = Task.Run(() => DiaryTable.UpdateUnitDiary(CommandUpdateModel.DiaryUpdate(FileSaveLocation, DiaryID)));
            Task          InsertCertifiedPackage = Task.Run(() => CertifiedPackageTable.Insert(CommandInsertModel.InsertCertifiedPackage(DiaryID, UDNumber, MembersEdipi, MembersLastName, MembersFirstName, MembersMI)));
            await         UpdateDiaryTable;
            await         InsertCertifiedPackage;

            CertifiedPackageList.UpdateList(DiaryID, UserName, InsertDate, FileSaveLocation, MembersEdipi, MembersLastName, MembersFirstName, MembersMI);
            return;
        }
示例#7
0
        /// <summary>
        /// Updates the Selected Diary in the Table
        /// </summary>
        /// <param name="DiaryID"></param>
        /// <param name="UDNumber"></param>
        /// <param name="FilePath"></param>
        /// <returns>Task Complete</returns>
        public static async Task UpdateRegularDiaryAsync(int DiaryID, string UDNumber, string FilePath)
        {
            string        fileName         = UDNumber + ".pdf";
            Task <string> SaveFile         = Task.Run(() => FileOperation.CopyFile(fileName, "Diary", FilePath));
            string        FileSaveLocation = await SaveFile;
            Task          UpdateDatabase   = Task.Run(() => DiaryTable.UpdateUnitDiary(CommandUpdateModel.DiaryUpdate(FileSaveLocation, DiaryID)));
            await         UpdateDatabase;

            DiaryList.UpdateList(DiaryID, UserName, InsertDate, FileSaveLocation);
            return;
        }