/// <summary> /// Created By : Ashwajit Bansod /// Created Date : 27-Aug-2019 /// Created For : To Save Vehicle seating chart data to database /// </summary> /// <param name="Obj"></param> /// <returns></returns> public AddChartModel SaveVSC(AddChartModel Obj) { var _workorderEMS = new workorderEMSEntities(); bool isSaved = false; try { var _VSCRepository = new VehicleSeatingChartRepository(); string Action = string.Empty; if (Obj != null && Obj.SeatingName != null) { if (Obj.Id == null) { isSaved = _VSCRepository.SaveVSCRepository(Obj); Obj.Id = _workorderEMS.VehicleSeatings.OrderByDescending(x => x.VST_Id).FirstOrDefault().VST_Id; } else { Obj.Action = "U"; Obj.IsActive = "Y"; isSaved = _VSCRepository.SaveVSCRepository(Obj); } } else { Obj = null; } } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public bool SaveVSC(AddChartModel Obj)", "Exception While Saving Vehicle seating chart.", Obj); throw; } return(Obj); }
public JsonResult DeleteDepartment(long id) { eTracLoginModel ObjLoginModel = null; var lst = new AddChartModel(); if (Session != null) { if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } } try { var data = _IDepartment.GetDepartmentData(id); if (data != null) { if (id > 0) { data.DeptId = id; var dataDetails = _IDepartment.DeleteDepartmentById(data); } } } catch (Exception ex) { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; } return(Json(lst, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Created y :Ashwajit Bansod /// Created Date : 11-Sept-2019 /// Created For : To get chart details by Id /// </summary> /// <param name="CSVChartId"></param> /// <returns></returns> public AddChartModel GetChartData(long CSVChartId) { var data = new AddChartModel(); try { var _VSCRepository = new VehicleSeatingChartRepository(); string Action = string.Empty; if (CSVChartId > 0) { data = _VSCRepository.GetChartDetails().Where(x => x.VST_Id == CSVChartId). Select(x => new AddChartModel() { Id = x.VST_Id, parentId = x.VST_ParentId, JobDescription = x.VST_JobDescription, RolesAndResponsibility = x.VST_RolesAndResponsiblities, SeatingName = x.VST_Title, Department = x.DPT_Id }).FirstOrDefault(); } } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public AddChartModel GetChartData(long CSVChartId)", "Exception While getting data of Vehicle Chart.", CSVChartId); throw; } return(data); }
/// <summary> /// Created By : Ashwajit Bansod /// Created Date : 27-Aug-2019 /// Created For : To Save Vehicle seating chart data to database /// </summary> /// <param name="Obj"></param> /// <returns></returns> public bool SaveVSC(AddChartModel Obj) { bool isSaved = false; try { var _VSCRepository = new VehicleSeatingChartRepository(); string Action = string.Empty; if (Obj != null && Obj.SeatingName != null) { if (Obj.Id == null) { Obj.Action = "I"; Obj.IsActive = "N"; isSaved = _VSCRepository.SaveVSCRepository(Obj); } else { Obj.Action = "U"; Obj.IsActive = "Y"; isSaved = _VSCRepository.SaveVSCRepository(Obj); } } else { isSaved = false; } } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public bool SaveVSC(AddChartModel Obj)", "Exception While Saving Vehicle seating chart.", Obj); throw; } return(isSaved); }
public JsonResult GetChartDetailsById(long CSVChartId) { eTracLoginModel ObjLoginModel = null; var lst = new AddChartModel(); if (Session != null) { if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } } try { if (CSVChartId > 0) { lst = _IAdminDashboard.GetChartData(CSVChartId); if (lst != null) { return(Json(lst, JsonRequestBehavior.AllowGet)); } else { return(Json(lst, JsonRequestBehavior.AllowGet)); } } } catch (Exception ex) { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; } return(Json(lst, JsonRequestBehavior.AllowGet)); }
public ActionResult SendVCSForApproval(AddChartModel Obj) { eTracLoginModel ObjLoginModel = null; Obj.IsDeleted = false; if (Session != null) { if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); Obj.UserId = ObjLoginModel.UserId; } } try { if (Obj != null && Obj.SeatingName != null) { if (Obj.RolesAndResponsibility != null) { var ex = System.Text.RegularExpressions.Regex.Replace(Obj.RolesAndResponsibility, @"<[^>]+>| ", "").Trim(); var removeNR = Obj.RolesAndResponsibility.Replace("\r\n", ""); var removepTag = removeNR.Replace("<p>", ""); var removeendTag = removepTag.Replace("</p>", ","); var removeSpace = removeendTag.Replace(" ", " "); System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex("<[^>]*>"); Obj.RolesAndResponsibility = removeSpace;//rx.Replace(Obj.RolesAndResponsibility, ""); } var _manager = new VehicleSeatingChartManager(); if (Obj.Id == null) { Obj.Action = "I"; Obj.IsActive = "N"; } var SavedData = _manager.SaveVSC(Obj); if (SavedData.Id > 0) { var data = _IePeopleManager.ApprovalRequisition(SavedData); ViewBag.Message = CommonMessage.SaveSuccessMessage(); } else { ViewBag.Message = CommonMessage.FailureMessage(); } } else { ViewBag.Message = CommonMessage.FailureMessage(); } } catch (Exception ex) { //ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; } var newModel = new AddChartModel(); ///return PartialView("_AddChart", newModel); return(Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Created By : Ashwajit Bansod /// Created Date : 20-Oct-2019 /// Created For : To save for approval requisition /// </summary> /// <param name="Obj"></param> /// <returns></returns> public bool ApprovalRequisition(AddChartModel Obj) { var _workorderEMS = new workorderEMSEntities(); bool isSaved = false; try { var ePeopleRepository = new ePeopleRepository(); string Action = string.Empty; var getEmpDetails = _workorderEMS.UserRegistrations.Where(x => x.UserId == Obj.UserId && x.IsDeleted == false && x.IsEmailVerify == true).FirstOrDefault(); if (getEmpDetails != null) { Obj.EmployeeId = getEmpDetails.EmployeeID; if (Obj.IsDeleted == false) { if (Obj != null && Obj.SeatingName != null) { if (Obj.RequisitionId == 0) { Obj.Action = "I"; Obj.ActionStatus = "Y"; Obj.IsActive = "Y"; Obj.RequisitionType = "Add Seat"; isSaved = ePeopleRepository.SendForApproval(Obj); } else { Obj.Action = "U"; Obj.IsActive = "Y"; isSaved = ePeopleRepository.SendForApproval(Obj); } } } else { Obj.ActionStatus = "X"; Obj.RequisitionType = "Remove Seat"; isSaved = ePeopleRepository.SendForApproval(Obj); } isSaved = true; } else { isSaved = false; } } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public bool ApprovalRequisition(AddChartModel Obj)", "Exception While Saving Vehicle seating chart.", Obj); throw; } return(isSaved); }
public ActionResult SaveVCS(AddChartModel Obj) { eTracLoginModel ObjLoginModel = null; if (Session != null) { if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } } try { if (Obj != null && Obj.SeatingName != null) { if (Obj.RolesAndResponsibility != null) { var ex = System.Text.RegularExpressions.Regex.Replace(Obj.RolesAndResponsibility, @"<[^>]+>| ", "").Trim(); var removepTag = Obj.RolesAndResponsibility.Replace("<p>", ""); var removeendTag = removepTag.Replace("</p>", ","); var removeSpace = removeendTag.Replace(" ", " "); System.Text.RegularExpressions.Regex rx = new System.Text.RegularExpressions.Regex("<[^>]*>"); Obj.RolesAndResponsibility = removeSpace;//rx.Replace(Obj.RolesAndResponsibility, ""); } if (Obj.Id == null) { Obj.Action = "I"; Obj.IsActive = "Y"; } var isSaved = _IAdminDashboard.SaveVSC(Obj); if (isSaved != null) { ViewBag.Message = CommonMessage.SaveSuccessMessage(); } else { ViewBag.Message = CommonMessage.FailureMessage(); } } else { ViewBag.Message = CommonMessage.FailureMessage(); } } catch (Exception ex) { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; } var newModel = new AddChartModel(); return(PartialView("_AddChart", newModel)); //return Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet); }
/// <summary> /// Created By :Ashwajit Bansod /// Created Date : 20-Oct-2019 /// Created For : To send VSC for Approval /// </summary> /// <param name="Obj"></param> /// <returns></returns> public bool SendForApproval(AddChartModel Obj) { try { var setData = objworkorderEMSEntities.spSetRequisition(Obj.RequisitionType, Obj.Id, Obj.ActionStatus, Obj.JobTitleCount, Obj.EmployeeId, null, null); //var data = objworkorderEMSEntities.spSetRequisitionApproval(Obj.RequisitionId,Obj.EmployeeId,Obj.Status,null,Obj.IsActive); return(true); } catch (Exception ex) { return(false); throw; } }
/// <summary> /// Created By : Ashwajit Bansod /// Created Date : 03-Sept-2019 /// Created For : To save Job Title /// </summary> /// <param name="Obj"></param> /// <returns></returns> public bool SaveJobTitleRepository(AddChartModel Obj) { bool isSave = false; try { var save = objworkorderEMSEntities.spSetJobTitle(Obj.Action, Obj.Id, Obj.JobTitleDesc, Obj.parentId, Obj.IsActive); isSave = true; } catch (Exception ex) { isSave = false; throw; } return(isSave); }
/// <summary> /// Created By: Ashwajit Bansod /// Created Date :27-Aug-2019 /// Created For : TO save chart Data /// </summary> /// <returns></returns> public bool SaveVSCRepository(AddChartModel Obj) { bool isSave = false; try { var save = objworkorderEMSEntities.spSetVehicleSeating(Obj.Action, Obj.Id, Obj.SeatingName, Obj.JobDesc, Obj.RolesAndResponsibility, Obj.Superior.ToString(), Obj.Superior, Obj.Department, Obj.IsActive); isSave = true; } catch (Exception ex) { isSave = false; throw; } return(isSave); }
public ActionResult OpenJobPostingForm(long CSVChartId) { var objeTracLoginModel = new eTracLoginModel(); var model = new JobPostingModel(); var chartModel = new AddChartModel(); if (CSVChartId > 0) { var data = _IAdminDashboard.GetChartData(CSVChartId); if (data != null) { chartModel.DepartmentName = data.DepartmentName; chartModel.SeatingName = data.SeatingName; chartModel.JobDescription = data.JobDescription.Replace("|", ","); chartModel.RolesAndResponsibility = data.RolesAndResponsibility; chartModel.Id = data.Id; model.AddChartModel = chartModel; } } //return Json("Acc", JsonRequestBehavior.AllowGet); return(PartialView("~/Areas/AdminSection/Views/OrgChart/_AddJobPosting.cshtml", model)); }
/// <summary> /// Created By :Ashwajit bansod /// Created Date : 22-Oct-2019 /// Created For : To send job title for approval /// </summary> /// <param name="model"></param> /// <returns></returns> public bool SendJobTitleForApproval(JobTitleModel model) { bool isSaved = false; var Obj = new AddChartModel(); try { var ePeopleRepository = new ePeopleRepository(); if (model != null) { Obj.JobTitleCount = model.JobTitleCount; Obj.Id = model.JobTitleId; if (model.JobTitleCount > model.JobTitleLastCount) { Obj.ActionStatus = "Y"; Obj.IsActive = "Y"; Obj.RequisitionType = "Add Head Count"; } else { Obj.ActionStatus = "Y"; Obj.IsActive = "Y"; Obj.RequisitionType = "Remove Head Count"; } isSaved = ePeopleRepository.SendForApproval(Obj); isSaved = true; } else { isSaved = false; } } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, " public bool SendJobTitleForApproval(JobTitleModel model)", "Exception While getting send job title for approval.", model); throw; } return(isSaved); }
public ActionResult SaveJobTitle(AddChartModel Obj) { eTracLoginModel ObjLoginModel = null; if (Session != null) { if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } } try { if (Obj != null && Obj.JobTitleDesc != null) { //Obj.Id = Obj.parentId; var isSaved = _IAdminDashboard.SaveJobTitleVSC(Obj); if (isSaved == true) { ViewBag.Message = CommonMessage.SaveSuccessMessage(); } else { ViewBag.Message = CommonMessage.FailureMessage(); } } else { ViewBag.Message = CommonMessage.FailureMessage(); } } catch (Exception ex) { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; } return(Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet)); }
public ActionResult SendVCSForDeleteApproval(long VSCId) { eTracLoginModel ObjLoginModel = null; var Obj = new AddChartModel(); Obj.IsDeleted = true; if (Session != null) { if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); Obj.UserId = ObjLoginModel.UserId; } } try { if (VSCId > 0) { Obj.Id = VSCId; var data = _IePeopleManager.ApprovalRequisition(Obj); ViewBag.Message = CommonMessage.SaveSuccessMessage(); } else { ViewBag.Message = CommonMessage.FailureMessage(); } } catch (Exception ex) { //ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; } var newModel = new AddChartModel(); ///return PartialView("_AddChart", newModel); return(Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Created By : Ashwajit Bansod /// Created Date : 03-Sept-2019 /// Created For : To save Job Title /// </summary> /// <param name="Obj"></param> /// <returns></returns> public bool SaveJobTitleVSC(AddChartModel Obj) { bool isSaved = false; try { var _VSCRepository = new VehicleSeatingChartRepository(); string Action = string.Empty; if (Obj != null && Obj.JobTitleDesc != null) { if (Obj.JobTitleId == null) { Obj.Action = "I"; Obj.IsActive = "N"; Obj.Id = Obj.JobTitleId; if (Obj.JobTitleDesc != null) { string[] JobTitleList = Obj.JobTitleDesc.Split('|'); foreach (string title in JobTitleList) { if (title != " " && title != "") { Obj.JobTitleDesc = title; isSaved = _VSCRepository.SaveJobTitleRepository(Obj); } } } } else { Obj.Action = "U"; Obj.IsActive = "Y"; Obj.Id = Obj.JobTitleId; //var getData = _VSCRepository.GetJobTitleList(Convert.ToInt64(Obj.parentId)); //if(getData != null) //{ // Obj.JobTitleDesc = getData.JBT_JobTitle + Obj.JobTitleDesc; //} if (Obj.JobTitleDesc != null) { string[] JobTitleList = Obj.JobTitleDesc.Split('|'); foreach (string title in JobTitleList) { isSaved = _VSCRepository.SaveJobTitleRepository(Obj); } } //isSaved = _VSCRepository.SaveJobTitleRepository(Obj); } } else { isSaved = false; } } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public bool SaveJobTitleVSC(AddChartModel Obj)", "Exception While Saving Job Title.", Obj); throw; } return(isSaved); }