public DtoActionResult AddImageProfileSysprep(EntityImageProfileSysprepTag imageProfileSysprep)
        {
            _uow.ImageProfileSysprepRepository.Insert(imageProfileSysprep);
            _uow.Save();
            var actionResult = new DtoActionResult();

            actionResult.Success = true;
            actionResult.Id      = imageProfileSysprep.Id;
            return(actionResult);
        }
Beispiel #2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            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 EntityImageProfileSysprepTag
                {
                    SysprepModuleId = 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.ImageProfileSysprepApi.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 DtoActionResult Post(EntityImageProfileSysprepTag imageProfileSysprep)
 {
     return(_imageProfileSysprepService.AddImageProfileSysprep(imageProfileSysprep));
 }