public ActionResult CancelRequest(string RID, string Type, DateTime StartDate, DateTime EndDate, string Comments) { //_logged = Logged(); //if (_logged == 0) //{ // return RedirectToAction("Index"); //} if (!CSessionManager.IsLoggedIn()) { return(RedirectToAction("Index")); } if (string.IsNullOrEmpty(RID) || string.IsNullOrEmpty(Type) || string.IsNullOrEmpty(StartDate.ToString())) { return(RedirectToAction("History")); } //var param = IWServices.CreateParameters(RID, (string)Session["UserID"], "", // Common.FormatEx.FormatDT(StartDate), // Common.FormatEx.FormatDT(EndDate), "", "", "", // "Pending", Comments, "", "1"); var param = IWServices.CreateParameters(RID, CSessionManager.IWSessionID, "", Common.FormatEx.FormatDT(StartDate), Common.FormatEx.FormatDT(EndDate), "", "", "", "Pending", Url.Encode(Comments), "", "1"); var done = GetCommandDataParam("ESS_003", CSessionManager.IWSessionID, param); return(RedirectToAction("History")); }
public ActionResult MyRequests(VMRequestTO request) { if (!CSessionManager.IsLoggedIn()) { return(RedirectToAction("Index")); } try { ViewData["Type"] = _data.TimeOffType(GetCommandData("ESS_002", CSessionManager.IWSessionID)); if (!ModelState.IsValid) { return(View(request)); } if (request.EndDate < request.StartDate) { ViewBag.Error = "Start Date is less than Current date or End Date is less than StartDate"; return(View(request)); } var usr = _functionCall.GetEmployeeInfo(CSessionManager.IWSessionID); var employee = new CEmployeeInfo(); foreach (DataRow rw in usr.Rows) { employee.EmpID = rw["EmpID"].ToString(); employee.Name = rw["Name"].ToString(); employee.Email = rw["Email1"].ToString(); employee.City = rw["City"].ToString(); employee.Country = rw["Country"].ToString(); employee.Birthday = rw["Birthday"].ToString(); employee.Gender = rw["Gender"].ToString(); employee.Nationality = rw["Nationality"].ToString(); employee.Title = rw["Title"].ToString(); employee.Phone = rw["Phone1"].ToString(); employee.State = rw["State"].ToString(); } var EmpID = employee.EmpID; //var param = IWServices.CreateParameters("-1", CSessionManager.IWSessionID, EmpID, request.Type, Common.FormatEx.FormatDT(request.StartDate), Common.FormatEx.FormatDT(request.EndDate), "", "", "", "Pending", request.Comment, "", "0"); var param = IWServices.CreateParameters("-1", EmpID, request.Type, Common.FormatEx.FormatDT(request.StartDate), Common.FormatEx.FormatDT(request.EndDate), DateTime.Now.Year.ToString(), "", "", "Pending", request.Comment, "", "0"); var done = GetCommandDataParam("ESS_003", CSessionManager.IWSessionID, param); //if (!string.IsNullOrEmpty(done.ToString())) //{ // ViewBag.ErrorMessage = "Sorry your request cannot be processed at this time, please contact HR"; // return View("MyRequests"); //} return(RedirectToAction("History")); } catch (Exception ex) { ViewBag.Error = ex.Message; return(View("Error")); } }
public ActionResult PayStubDetails(string EmpDate, string empID) { if (!CSessionManager.IsLoggedIn()) { return(RedirectToAction("Index")); } try { ViewBag.PayDate = EmpDate; var param = IWServices.CreateParameters(EmpDate, empID); ViewData["NetPay"] = _data.NetPayWord(GetCommandDataParam("P_00062", CSessionManager.IWSessionID, param)); ViewData["GrossDeductions"] = _data.GrossEarnings(GetCommandDataParam("P_00064", CSessionManager.IWSessionID, param)); ViewData["GrossEarnings"] = _data.GrossEarnings(GetCommandDataParam("P_00063", CSessionManager.IWSessionID, param)); ViewData["EmpPay"] = _data.EmployeePay(GetCommandDataParam("P_00065", CSessionManager.IWSessionID, param)); return(View()); } catch (Exception ex) { ViewBag.Error = ex.Message; return(View("Error")); } }