public ActionResultDTO AddImageProfileSysprepTag(ImageProfileSysprepTagEntity imageProfileSysprepTag) { _uow.ImageProfileSysprepRepository.Insert(imageProfileSysprepTag); _uow.Save(); var actionResult = new ActionResultDTO(); actionResult.Success = true; actionResult.Id = imageProfileSysprepTag.Id; return(actionResult); }
public ActionResultDTO Post(ImageProfileSysprepTagEntity 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); }
protected void btnUpdateSysprep_OnClick(object sender, EventArgs e) { RequiresAuthorizationOrManagedImage(AuthorizationStrings.UpdateProfile, Image.Id); var deleteResult = Call.ImageProfileApi.RemoveProfileSysprepTags(ImageProfile.Id); var checkedCount = 0; foreach (GridViewRow row in gvSysprep.Rows) { var enabled = (CheckBox)row.FindControl("chkEnabled"); if (enabled == null) { continue; } if (!enabled.Checked) { continue; } checkedCount++; var dataKey = gvSysprep.DataKeys[row.RowIndex]; if (dataKey == null) { continue; } var profileSysPrep = new ImageProfileSysprepTagEntity { SysprepId = Convert.ToInt32(dataKey.Value), ProfileId = ImageProfile.Id }; var txtPriority = row.FindControl("txtPriority") as TextBox; if (txtPriority != null) { if (!string.IsNullOrEmpty(txtPriority.Text)) { profileSysPrep.Priority = Convert.ToInt32(txtPriority.Text); } } EndUserMessage = Call.ImageProfileSysprepTagApi.Post(profileSysPrep).Success ? "Successfully Updated Image Profile" : "Could Not Update Image Profile"; } if (checkedCount == 0) { EndUserMessage = deleteResult ? "Successfully Updated Image Profile" : "Could Not Update Image Profile"; } }
public ActionResultDTO Post(ImageProfileSysprepTagEntity imageProfileFileFolder) { return(_imageProfileSysprepTagServices.AddImageProfileSysprepTag(imageProfileFileFolder)); }