public ActionResult SubmitUpdateEmployee(int id, string empCode, string empFirstName, string empLastMiddle, string empIdentifierNumber, string empAddress, string empDistrict, string empCity, string empCountry, string empPhone, string empEmail, string empWebsite, string empSummary) { logger.EnterMethod(); try { var emp = new VM_StaffInformation() { Id = id, StaffCode = empCode, FirstName = empFirstName, LastMiddle = empLastMiddle, IdentifierNumber = empIdentifierNumber, Summary = empSummary, IsInUse = true, Image = "[nullimage]", Salary = (decimal)0 }; var insertSuccess = this._iStaffServices.UpdateEmployee(ConvertVM.VMStaffInformation_To_Staff(emp)); if (insertSuccess) // Insert new employee success { var contactForId = this._iContactInformationServices.GetContactForId("Staff"); var contactTypeId = this._iContactInformationServices.GetContactTypeId("Address"); var empId = this._iStaffServices.GetLast(); var contactInformation = new VM_ContactInformation() { Address = new VM_Address() { AddressNumberNoAndStreet = empAddress, District = new VM_District() { DistrictName = empDistrict, Province = new VM_Province() { ProvinceName = empCity, Country = new VM_Country() { CountryName = empCountry } } } }, ContactForId = contactForId, ContactTypeId = contactTypeId, EAddress = new VM_EAddress() { Email = empEmail, NumberPhone = empPhone, Website = empWebsite, StaffId = empId.Id }, IsInUse = true, PersonId = empId.Id }; var updateContactInformation = this._iContactInformationServices.CheckContactInformationExistingAndUpdateForPerson(ConvertVM.VMContactInformation_To_ContactInformation(contactInformation)); if (updateContactInformation) { return(Json(JsonConvert.SerializeObject(JObject.Parse(@"{insertEmp: true, updateContactInformation: true, personid: '" + empId.Id + "'}")))); } else { return(Json(JsonConvert.SerializeObject(JObject.Parse(@"{insertEmp: true, updateContactInformation: false, personid: '" + empId.Id + "'}")))); } } else { return(Json(JsonConvert.SerializeObject(JObject.Parse(@"{insertEmp: false}")))); } } catch (Exception ex) { logger.Error("Error: [" + ex.Message + "]"); return(Json(@"{insertEmp: false}")); } finally { logger.LeaveMethod(); } }