public ActionResult EmployeeTransfer(int empCode, EmployeeJobHistoryViewModel data) { data.DecisionDate = !string.IsNullOrEmpty(data.DecisionDateNP)? Convert.ToDateTime(NepEngDate.NepToEng(data.DecisionDateNP)):data.DecisionDate; data.LetterIssueDate = !string.IsNullOrEmpty(data.LetterIssueDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.LetterIssueDateNP)):data.LetterIssueDate; data.EffectiveDate = !string.IsNullOrEmpty(data.EffectiveDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.EffectiveDateNP)): data.EffectiveDate; data.ServiceCountingFromDate = !string.IsNullOrEmpty(data.ServiceCountingFromDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.ServiceCountingFromDateNP)): data.ServiceCountingFromDate; data.OfficeJoinDate = !string.IsNullOrEmpty(data.OfficeJoinDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.OfficeJoinDateNP)) : data.OfficeJoinDate; data.SadarDate = !string.IsNullOrEmpty(data.SadarDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.SadarDateNP)): data.SadarDate; if (!ViewBag.AllowView) { ViewBag.Error = "You are not Authorize to use this Page"; return(PartialView("_partialviewNotFound")); } ListOfDatas(empCode); try { if (!ModelState.IsValid) { return(View("../Employee/Transfer/Index", data)); } EmployeeJobHistoryDTO dataToInsert = new EmployeeJobHistoryDTO(); dataToInsert.EmpCode = data.EmpCode; dataToInsert.Instruction = data.Instruction; dataToInsert.JobTypeId = data.JobTypeId; dataToInsert.LetterRefNo = data.LetterChalaniNumber; dataToInsert.LetterIssueDate = data.LetterIssueDate; dataToInsert.LevelId = data.LevelId; dataToInsert.OfficeId = data.OfficeId; dataToInsert.OfficeJoinDate = data.OfficeJoinDate; dataToInsert.RankId = data.RankId; dataToInsert.RemoteId = data.RemoteId; dataToInsert.SadarDate = data.SadarDate; dataToInsert.SadarGarneEmployeeCode = data.SadarGarneEmployeeCode; dataToInsert.SectionId = data.SectionId; dataToInsert.ServiceHolidingDate = data.ServiceCountingFromDate; dataToInsert.ServiceEvent = data.ServiceEvent; dataToInsert.Instruction = data.Instruction; dataToInsert.ServiceEventGroupId = 2; dataToInsert.ServiceEventSubGroupId = data.ServiceEventSubGroupId; dataToInsert.ShiftId = data.ShiftId; dataToInsert.DeptId = data.DeptId; dataToInsert.DesgId = data.DesgId; dataToInsert.DesgKayamMukayamMuKaRaRa = data.DesgKayamMukayamMuKaRaRa; dataToInsert.EffectiveDate = data.EffectiveDate; dataToInsert.EffectiveTillDate = data.EffectiveTillDate; dataToInsert.BusinessGroupId = data.BusinessGroupId; dataToInsert.DecisionDate = data.DecisionDate; dataToInsert.RemoteCode = data.RemoteCode; int res = _jobHistoryService.InsertJobHistoryForSaruwa(dataToInsert); return(Redirect("/History/" + data.EmpCode)); } catch (Exception ex) { ViewBag.Error = ex.Message; return(View("../Employee/Transfer/Index", data)); } }