Пример #1
0
        public ActionResult DeleteFixOrganization(DataSourceLoadOptions loadOptions, string value)
        {
            try
            {
                var deleteFixOrganization = new FixOrganizationViewModel();
                JsonConvert.PopulateObject(value, deleteFixOrganization);

                deleteFixOrganization.UpdateBy = UserDetail.UserID;
                DeleteFixOrgByEmpResult result = MasterService.DeleteFixOrganization(deleteFixOrganization.ToEntity());

                return(Content(JsonConvert.SerializeObject(GetMsgFromDeleteActionResult(result)), ConstantValues.JSON_CONTENT_TYPE));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public ActionResult UpdateFixOrganization(DataSourceLoadOptions loadOptions, string value)
        {
            try
            {
                var newFixOrganization = new FixOrganizationViewModel();
                JsonConvert.PopulateObject(value, newFixOrganization);

                ValidateModel(newFixOrganization);
                if (!ModelState.IsValid)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, ModelState.ToString()));
                }

                newFixOrganization.UpdateBy = UserDetail.UserID;
                SaveFixOrgByEmpResult result = MasterService.SaveFixOrganization(newFixOrganization.ToEntity(), ConstantValues.EDIT);

                return(Content(JsonConvert.SerializeObject(GetMsgFromInsertUpdateActionResult(result)), ConstantValues.JSON_CONTENT_TYPE));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }