public ActionResultDTO Post(ImageProfileFileFolderEntity tObject) { Request.Method = Method.POST; Request.AddJsonBody(tObject); Request.Resource = string.Format("api/{0}/Post/", Resource); var response = _apiRequest.Execute <ActionResultDTO>(Request); if (response.Id == 0) { response.Success = false; } return(response); }
public ActionResultDTO AddImageProfileFileFolder(ImageProfileFileFolderEntity imageProfileFileFolder) { imageProfileFileFolder.DestinationFolder = StringManipulationServices.WindowsToUnixFilePath(imageProfileFileFolder.DestinationFolder); if (imageProfileFileFolder.DestinationFolder.Trim().EndsWith("/") && imageProfileFileFolder.DestinationFolder.Length > 1) { char[] toRemove = { '/' }; var trimmed = imageProfileFileFolder.DestinationFolder.TrimEnd(toRemove); imageProfileFileFolder.DestinationFolder = trimmed; } _uow.ImageProfileFileFolderRepository.Insert(imageProfileFileFolder); _uow.Save(); var actionResult = new ActionResultDTO(); actionResult.Success = true; actionResult.Id = imageProfileFileFolder.Id; return(actionResult); }
protected void btnUpdateFile_OnClick(object sender, EventArgs e) { RequiresAuthorizationOrManagedImage(AuthorizationStrings.UpdateProfile, Image.Id); var deleteResult = Call.ImageProfileApi.RemoveProfileFileFolders(ImageProfile.Id); var checkedCount = 0; foreach (GridViewRow row in gvFile.Rows) { var enabled = (CheckBox)row.FindControl("chkEnabled"); if (enabled == null) { continue; } if (!enabled.Checked) { continue; } checkedCount++; var dataKey = gvFile.DataKeys[row.RowIndex]; if (dataKey == null) { continue; } var profileFileFolder = new ImageProfileFileFolderEntity { FileFolderId = Convert.ToInt32(dataKey.Value), ProfileId = ImageProfile.Id }; var txtPriority = row.FindControl("txtPriority") as TextBox; if (txtPriority != null) { if (!string.IsNullOrEmpty(txtPriority.Text)) { profileFileFolder.Priority = Convert.ToInt32(txtPriority.Text); } } var txtPartition = row.FindControl("txtPartition") as TextBox; if (txtPartition != null) { profileFileFolder.DestinationPartition = txtPartition.Text; } var txtPath = row.FindControl("txtPath") as TextBox; if (txtPath != null) { profileFileFolder.DestinationFolder = txtPath.Text; } var ddlFolderMode = row.FindControl("ddlFolderMode") as DropDownList; if (ddlFolderMode != null) { profileFileFolder.FolderCopyType = ddlFolderMode.Text; } EndUserMessage = Call.ImageProfileFileFolderApi.Post(profileFileFolder).Success ? "Successfully Updated Image Profile" : "Could Not Update Image Profile"; } if (checkedCount == 0) { EndUserMessage = deleteResult.Success ? "Successfully Updated Image Profile" : "Could Not Update Image Profile"; } }
public ActionResultDTO Post(ImageProfileFileFolderEntity imageProfileFileFolder) { return(_imageProfileFileFolderService.AddImageProfileFileFolder(imageProfileFileFolder)); }