public ActionResult CreateHolidayList(HolidayList objholidaylist) { try { cHolidayList objholiday = cHolidayList.Create(); objholiday.sOccassion = objholidaylist.Occassion; objholiday.dtOccDate = Convert.ToDateTime(objholidaylist.Date); objholiday.sDescription = objholidaylist.Description; objholiday.Save(); Session["Result"] = "1"; LeaveViewModel objleaveviewmodel = new LeaveViewModel(); return RedirectToAction("HolidayList"); } catch (Exception ex) { throw ex; } }
public ActionResult CreateRequest() { try { LeaveViewModel objLeaveViewModel = new LeaveViewModel(); int LoginID = Convert.ToInt32(HttpContext.User.Identity.Name); int manageID = cEmpLogin.Get_ID(LoginID).objManageGroup.iObjectID; cManageGroup objmanage = cManageGroup.Get_ID(manageID); int ReportHeadID = objmanage.iReportingHead; List<cEmpPersonalDetails> objPersona = cEmpPersonalDetails.Find(" objEmpLogin = "******"EmployeeCode"].ToString(); objLeaveViewModel.EmployeeDepartment = dt.Rows[0]["DepartmentType"].ToString(); objLeaveViewModel.EmployeeDesignation = dt.Rows[0]["Designation"].ToString(); objLeaveViewModel.EmployeeName = dt.Rows[0]["Firstname"].ToString(); if (objPersona.Count > 0) { objLeaveViewModel.EmployeeReportingHead = objPersona[0].sFirstName + " " + objPersona[0].sLastName; } else { objLeaveViewModel.EmployeeReportingHead = ""; } } cEmpLogin objEmpLogin = cEmpLogin.Get_ID(LoginID); objLeaveViewModel.LeaveTypeList = getLeaveTypeList(); return View(objLeaveViewModel); } catch (Exception ex) { throw ex; } }
public JsonResult CreateRequest(LeaveViewModel objViewModel) { try { cEmpLeave objempleave = cEmpLeave.Create(); string LeavetypeID = objViewModel.SelectedLeaveType[0].ToString(); objempleave.objLeaveType.iObjectID = Convert.ToInt32(LeavetypeID); objempleave.dtFromDate = objViewModel.objEmployeeLeave.FromDate; objempleave.dtToDate = objViewModel.objEmployeeLeave.ToDate; objempleave.sReason = objViewModel.objEmployeeLeave.Reason; objempleave.sLeaveStatus = "2"; objempleave.objEmpLogin.iObjectID = Convert.ToInt32(HttpContext.User.Identity.Name); int manageID = cEmpLogin.Get_ID(Convert.ToInt32(HttpContext.User.Identity.Name)).objManageGroup.iObjectID; cManageGroup objmanage = cManageGroup.Get_ID(manageID); objempleave.iReportingHead = objmanage.iReportingHead; objempleave.bIsActive = true; objempleave.Save(); int IreportHead = objmanage.iReportingHead; ; string reporterEmail = cEmpLogin.Get_ID(IreportHead).sEmailID; List<cEmpPersonalDetails> aobOer = cEmpPersonalDetails.Find(" objEmpLogin = "******" " + aobOer[0].sLastName; List<cEmpPersonalDetails> aobre = cEmpPersonalDetails.Find(" objEmpLogin = "******" " + aobre[0].sLastName; MailLeaveRequest(ReprtingHead, ReprtingFrom, reporterEmail); return Json("1"); } catch (Exception ex) { throw ex; } }