public ActionResult AcceptRejectInterviewTime(long IPT_Id, string Status) { var _IePeopleManager = new ePeopleManager(); var _workorderems = new workorderEMSEntities(); var common_B = new Common_B(); try { if (IPT_Id > 0 && Status != null) { _IePeopleManager.ScheduleInterviewOfApplicant(IPT_Id, Status); //common_B.SaveApplicantStatus(ApplicantId, ApplicantStatus.I, ApplicantIsActiveStatus.I); return(View("~/Views/Error/_ThankYou.cshtml")); } else { ViewBag.Error = CommonMessage.WrongParameterMessage(); return(View("~/Views/Error/_Error.cshtml")); } } catch (Exception ex) { ViewBag.Error = ex; return(View("~/Views/Error/_Error.cshtml")); } }
public ActionResult LoginForOnboarding(long ApplicantId) { var _workorderems = new workorderEMSEntities(); var common_B = new Common_B(); if (ApplicantId > 0) { common_B.SaveApplicantStatus(ApplicantId, ApplicantStatus.Onboarding, ApplicantIsActiveStatus.Onboarding); return(RedirectToAction("Index", "Login")); } return(RedirectToAction("Index", "Login")); }
public ActionResult DisplayLocationData(int LocationId, int?rows = 20, int?page = 1, int?TotalRecords = 10, string sord = null, String sidx = null, string txtSearch = null) { eTracLoginModel ObjLoginModel = null; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); var details = new LocationDetailsModel(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); if (LocationId == null) { LocationId = Convert.ToInt32(ObjLoginModel.LocationID); } } try { sord = string.IsNullOrEmpty(sord) ? "desc" : sord; sidx = string.IsNullOrEmpty(sidx) ? "LocationId" : sidx; var obj_Common_B = new Common_B(); ObjectParameter paramTotalRecords = new ObjectParameter("TotalRecords", typeof(int)); var data = _GlobalAdminManager.LocationDetailByLocationID(LocationId); if (data.Count() > 0) { var ListLocationModel = new ListLocationModel(); var serivces = obj_Common_B.GetLocationServicesByLocationID(LocationId, 0); foreach (var locList in data) { //var id = Cryptography.GetEncryptedData(locList.LocationId.ToString(), true); ListLocationModel.LocationName = locList.LocationName; ListLocationModel.Address = locList.Address1 + "," + locList.Address2; ListLocationModel.City = locList.City; ListLocationModel.State = locList.LocationState; ListLocationModel.Country = locList.LocationCountry; ListLocationModel.Mobile = locList.PhoneNo + " / " + locList.Mobile; ListLocationModel.Description = locList.Description; ListLocationModel.ZipCode = locList.ZipCode; ListLocationModel.LocationSubTypeDesc = locList.LocationSubTypeDesc; //ListLocationModel.LocationCode = locList.Loc; ListLocationModel.LocationServices = serivces; } details.ListLocationModel = ListLocationModel; } } catch (Exception ex) { } return(View(details)); }
public bool SetUserSelectedLocation(long LocationId, string LocationName) { try { if (Session["eTrac"] != null) { Common_B obj_Common_B = new Common_B(); eTracLoginModel obj_eTracLoginModel = new eTracLoginModel(); obj_eTracLoginModel = (eTracLoginModel)Session["eTrac"]; //Added By Bhushan Dod on 24-April-2016 for maintaining log of active user by location if selected from loc ddl _ILogin.ChangeLoginLogActiveStatus(obj_eTracLoginModel); obj_eTracLoginModel.LocationID = LocationId; obj_eTracLoginModel.Location = LocationName; //Added By Bhushan Dod on 24-April-2016 for maintaining log of active logid by location if selected from loc ddl var objNewLogID = _ILogin.InsertLoginLog(obj_eTracLoginModel); obj_eTracLoginModel.LogId = objNewLogID.LogId; Session["eTrac"] = obj_eTracLoginModel; Session["eTrac_SelectedDasboardLocationID"] = LocationId; Session["eTrac_UserRoles"] = this.Get_UserAssignedRoles(); Session["eTrac_LocationServices"] = obj_Common_B.GetLocationServicesByLocationID(LocationId, obj_eTracLoginModel.UserRoleId); Session["eTrac_DashboardWidget"] = null; Session["eTrac_DashboardWidget"] = this.GetUserDashboardWidget(); if (obj_eTracLoginModel.UserRoleId == 1 || obj_eTracLoginModel.UserRoleId == 5)// 1 - GlobalAdmin ,2 IT Admin { Session["eTrac_UserRoles"] = Session["eTrac_LocationServices"]; } return(true); } else { return(false); } } catch (Exception) { return(false); } }
public JsonResult GetWorkOrderList(long LocationId, long workRequestProjectId, string filterwrtype, string filterqrc, string filter) { eTracLoginModel ObjLoginModel = null; var details = new List <WorkRequestAssignmentModelList>(); long UserId = 0, RequestedBy = 0; int? rows = 20; int?page = 1; int? TotalRecords = 10; string sord = null; String sidx = null; string txtSearch = ""; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); UserId = ObjLoginModel.UserId; if (LocationId == 0) { LocationId = Convert.ToInt32(ObjLoginModel.LocationID); } } sord = string.IsNullOrEmpty(sord) ? "desc" : sord; sidx = string.IsNullOrEmpty(sidx) ? "CreatedDate" : sidx; DateTime StartDate = DateTime.UtcNow; DateTime EndDate = DateTime.UtcNow; var obj_Common_B = new Common_B(); ObjectParameter paramTotalRecords = new ObjectParameter("TotalRecords", typeof(int)); var data = _GlobalAdminManager.GetAllWorkRequestAssignmentList(workRequestProjectId, RequestedBy, "GetAllWorkRequestAssignment", page, rows, sidx, sord, txtSearch, LocationId, UserId, StartDate, EndDate, (filter == "All" ? "" : filter), (filterqrc == "All" ? "" : filterqrc), (filterwrtype == "All" ? "" : filterwrtype), paramTotalRecords); if (data.Count() > 0) { foreach (var item in data) { item.id = Cryptography.GetEncryptedData(item.WorkRequestAssignmentID.ToString(), true); item.QRCType = String.IsNullOrEmpty(item.QRCType) ? ((item.eFleetVehicleID != null && item.eFleetVehicleID != "" ? "Shuttle Bus" : "N/A")) : item.QRCType + " (" + item.QRCodeID + ")"; item.FacilityRequestType = (item.FacilityRequestType == null || item.FacilityRequestType.TrimWhiteSpace() == "" || item.FacilityRequestType.Trim() == "") ? "N/A" : item.FacilityRequestType; item.ProfileImage = item.ProfileImage == null ? HostingPrefix + ConstantImages.Replace("~", "") + "no-profile-pic.jpg" : HostingPrefix + ProfilePicPath.Replace("~", "") + item.ProfileImage; item.AssignedWorkOrderImage = item.AssignedWorkOrderImage == null ? HostingPrefix + ConstantImages.Replace("~", "") + "no-asset-pic.png" : HostingPrefix + WorkRequestImagepath.Replace("~", "") + item.AssignedWorkOrderImage; details.Add(item); } return(Json(details, JsonRequestBehavior.AllowGet)); } else { return(Json(details, JsonRequestBehavior.AllowGet)); } }
public ActionResult Index(eTracLoginModel eTracLogin) { try { //TimeZoneInfo nyTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); //DateTime nyTime = GetLocalDateTime(DateTime.UtcNow, nyTimeZone); //if (nyTimeZone.IsDaylightSavingTime(nyTime)) string loginMessage = ""; if (ModelState.IsValid) { eTracLoginModel result = _ILogin.AuthenticateUser(eTracLogin); //result.RememberMe = eTracLogin.RememberMe; if (result.UserId > 0) { this.CreateAuthenticateFormsTicket(result); Common_B obj_Common_B = new Common_B(); Session["eTrac_SelectedDasboardLocationID"] = result.LocationID; Session["eTrac_UserRoles"] = this.Get_UserAssignedRoles(); Session["eTrac_DashboardWidget"] = this.GetUserDashboardWidget(); Session["eTrac_LocationServices"] = obj_Common_B.GetLocationServicesByLocationID(result.LocationID, result.UserRoleId); Session["eTrac_ProfileImage"] = result.ProfileImage; CallbackController.UserRoleId = result.UserRoleId; CallbackController.UserId = result.UserId; HomeController.UserRoleId = result.UserRoleId; HomeController.UserId = result.UserId; switch (result.UserRoleId) { case ((Int64)(UserType.GlobalAdmin)): Session["eTrac_UserLocations"] = _ILogin.GetUserAssignedLocations(result.UserRoleId, result.UserId); Session["eTrac_UserRoles"] = Session["eTrac_LocationServices"]; // this line has been added by vijay bcz if usetype is GAdmin or ITAdmin then this type of users will be able too see all services which is assigned to this current location. // QuickBookIndex(); return(RedirectToAction("Index", "GlobalAdmin")); break; case ((Int64)(UserType.ITAdministrator)): Session["eTrac_UserLocations"] = _ILogin.GetUserAssignedLocations(result.UserRoleId, result.UserId); Session["eTrac_UserRoles"] = Session["eTrac_LocationServices"]; //QuickBookIndex(); return(RedirectToAction("Index", "ITAdministrator")); break; case ((Int64)(UserType.Administrator)): Session["eTrac_UserLocations"] = _ILogin.GetAdminAssignedLocation(result.UserId); // QuickBookIndex(); return(RedirectToAction("Index", "Administrator")); break; case ((Int64)(UserType.Manager)): Session["eTrac_UserLocations"] = _ILogin.GetManagerAssignedLocation(result.UserId); #region this code will execute only when manager declined vendor from vendor email verification page. try { if (Request.Cookies["eTrack_VendorIdForEditAfterDeclinedByManager"] != null) { string isVendorIDExists = Request.Cookies["eTrack_VendorIdForEditAfterDeclinedByManager"]["VendorID"]; if (isVendorIDExists != null) { var abc = Cryptography.GetDecryptedData(isVendorIDExists, true); if (Convert.ToInt32(abc) > 0) { //string HostingPrefix = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["hostingPrefix"], System.Globalization.CultureInfo.InvariantCulture); //var adfadsf = HostingPrefix + "/Manager/EditRegisterVendor/?vdr=" + isVendorIDExists; //Response.Redirect(adfadsf); // QuickBookIndex(); return(RedirectToAction("EditRegisterVendor", "Manager", new { vdr = isVendorIDExists })); } } } } catch { } #endregion // by vijay sahu on 2 july 2015 #region This Code Will Execute if Vehicle Declined by Manager and after login redirect to edit vehicle try { if (Request.Cookies["eTrac_VehicleIdForEditAfterDeclinedByManager"] != null) { string isVehicleIDExists = Request.Cookies["eTrac_VehicleIdForEditAfterDeclinedByManager"]["QRCID"]; if (isVehicleIDExists != null) { var abc = Cryptography.GetDecryptedData(isVehicleIDExists, true); if (Convert.ToInt32(abc) > 0) { //string HostingPrefix = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["hostingPrefix"], System.Globalization.CultureInfo.InvariantCulture); var redirectURL = HostingPrefix + "QRCSetup/VehicleRegistration/?qr=" + isVehicleIDExists; Response.Redirect(redirectURL); //return RedirectToAction("VehicleRegistration", "QRCSetup", new { qr = isVehicleIDExists }); } } } } catch { } #endregion // by Bhushan Dod on 22 September 2015 //QuickBookIndex(); return(RedirectToAction("Dashboard", "Manager")); break; case ((Int64)(UserType.Employee)): Session["eTrac_UserLocations"] = _ILogin.GetEmployeeAssignedLocation(result.UserId); //QuickBookIndex(); return(RedirectToAction("Index", "Employee")); break; case ((Int64)(UserType.Client)): //Session["eTrac_UserLocations"] = _ILogin.GetEmployeeAssignedLocation(result.UserId); //QuickBookIndex(); return(RedirectToAction("Index", "Client")); break; } }//else { ModelState.AddModelError("", "User not found. Please check UserName or Password"); } else { loginMessage = "User not found. Please check Username or Password"; } }//else { ModelState.AddModelError("", "Invalid UserName or Password"); } else { loginMessage = "Invalid Username or Password"; } ViewBag.Message = loginMessage; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; } catch (Exception ex) { Exception_B.exceptionHandel_Runtime(ex, "public ActionResult Index(eTracLoginModel eTracLogin)", "from loginController", eTracLogin); ViewBag.Error = ex.Message; ViewBag.Message = "Something went wrong. Please contact support team."; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; }//ModelState.AddModelError("", ex.Message); return(View("Index", eTracLogin)); }
public JsonResult GeDARList(long?LocationId, int?TastType, long?EmployeeId, string FromDate, string ToDate, string FromTime, string ToTime) { eTracLoginModel ObjLoginModel = null; DARManager objDARDetailsList = new DARManager(); var details = new List <WorkRequestAssignmentModelList>(); long UserId = 0; string sord = null; String sidx = null; string txtSearch = ""; GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager(); if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); UserId = ObjLoginModel.UserId; if (LocationId == 0) { LocationId = Convert.ToInt32(ObjLoginModel.LocationID); UserId = ObjLoginModel.UserId; } } //Getting client date time. var clientdt = DateTime.UtcNow.GetClientDateTimeNow(); //flag status for if user filter record in time span so to date is till midnight. bool isUTCDay = true; //Fetching record like 2017-06-11T00:00:00-04:00 to 2017-06-12T00:0000-04:00 string fromDate = (FromDate == null || FromDate == " " || FromDate == "") ? clientdt.Date.ToString() : FromDate; string toDate = (ToDate == null || ToDate == " " || ToDate == "") ? clientdt.AddDays(1).Date.ToString() : ToDate; //maintaining flag if interval date come then need to fetch record till midnight of todate day if (ToDate != null && ToDate != "" && FromDate != "null") { DateTime tt = Convert.ToDateTime(toDate); if (tt.ToLongTimeString() == "12:00:00 AM") { isUTCDay = false; } } if (fromDate != null && toDate != null) { DateTime frmd = Convert.ToDateTime(fromDate); DateTime tod = Convert.ToDateTime(toDate); ////if interval date come then need to fetch record till midnight of todate day if ((frmd.Date != tod.Date) && (tod.ToLongTimeString() == "12:00:00 AM") && isUTCDay == false) { tod = tod.AddDays(1).Date; toDate = tod.ToString(); } if ((frmd.Date == tod.Date) && (tod.ToLongTimeString() == "12:00:00 AM")) { tod = tod.AddDays(1).Date; toDate = tod.ToString(); } } //Converting datetime from userTZ to UTC fromDate = Convert.ToDateTime(fromDate).ConvertClientTZtoUTC().ToString(); toDate = Convert.ToDateTime(toDate).ConvertClientTZtoUTC().ToString(); int?rows = 20; int?page = 1; sord = string.IsNullOrEmpty(sord) ? "desc" : sord; sidx = string.IsNullOrEmpty(sidx) ? "CreatedDate" : sidx; var obj_Common_B = new Common_B(); ObjectParameter paramTotalRecords = new ObjectParameter("TotalRecords", typeof(int)); var data = objDARDetailsList.GetDARDetails(UserId, LocationId, EmployeeId, TastType, page, rows, sord, sord, txtSearch, paramTotalRecords, fromDate, toDate); if (data.Count() > 0) { return(Json(data, JsonRequestBehavior.AllowGet)); } else { return(Json(data, JsonRequestBehavior.AllowGet)); } }