Exemplo n.º 1
0
        /// <summary>
        /// Created By: Ashwajit bansod
        /// Created Date : 03-Oct-2018
        /// Created For: to edit PO as per POId
        /// </summary>
        /// <param name="POId"></param>
        /// <param name="LocationId"></param>
        /// <returns></returns>
        public ActionResult EditPOByPOId(string POId, long LocationId)
        {
            eTracLoginModel ObjLoginModel  = null;
            long            Id             = 0;
            var             objPOTypeModel = new POTypeDataModel();

            try
            {
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                }
                if (!string.IsNullOrEmpty(POId))
                {
                    ViewBag.UpdateMode = true;
                    POId = Cryptography.GetDecryptedData(POId, true);
                    long.TryParse(POId, out Id);
                }
                if (Id > 0)
                {
                    var DataPO = _IPOTypeDetails.GetPODetailsById(Id);
                    ViewBag.Vendor       = DataPO.Vendor;
                    ViewBag.POTypeDate   = DataPO.POType;
                    ViewBag.PONumberData = DataPO.PONumber;
                    ViewBag.POType       = _IPOTypeDetails.POTypeList();
                    ViewBag.VendorList   = _IPOTypeDetails.GetCompany_VendorList(LocationId, false);
                    return(View("Index", DataPO));
                }
                else
                {
                    ViewBag.AlertMessageClass = new AlertMessageClass().Danger;
                    ViewBag.Message           = Result.DoesNotExist;
                }
            }
            catch (Exception ex)
            {
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
            }
            return(View("Index"));
        }
Exemplo n.º 2
0
        public ActionResult SavePDFFormDetails(PDFFormModel objPDFFormModel)
        {
            eTracLoginModel ObjLoginModel = null;

            ViewBag.AccountSection = true;
            if (Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
            }
            try
            {
                if (objPDFFormModel.FormPathFile != null)
                {
                    string FileName = ObjLoginModel.UserId + "_" + DateTime.Now.Ticks.ToString() + "_" + Convert.ToString(objPDFFormModel.FormPathFile.FileName);
                    CommonHelper.StaticUploadImage(objPDFFormModel.FormPathFile, Server.MapPath(ConfigurationManager.AppSettings["PDFForm"]), FileName);
                    objPDFFormModel.FormPath = FileName;
                }
                var savedStatus = _IPDFFormManager.SavePDFForm(objPDFFormModel);
                ViewBag.ModuleList = _IPDFFormManager.GetModuleList();
                if (savedStatus == true)
                {
                    ViewBag.Message           = CommonMessage.SaveSuccessMessage();
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Success;
                    ModelState.Clear();
                }
                else
                {
                    ViewBag.Message           = CommonMessage.FailureMessage();
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;// store the failure message in tempdata to display in view.
                }
                var obj = new PDFFormModel();
                return(View("~/Areas/AdminSection/Views/PDFForm/Index.cshtml", obj));
                //return Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
                throw ex;
            }
        }
        public JsonResult GetAllPendingPODetails(DateTime?fromDate, DateTime?toDate, long?VendorId)
        {
            eTracLoginModel objLoginSession = new eTracLoginModel();

            if ((eTracLoginModel)Session["eTrac"] != null)
            {
                objLoginSession = (eTracLoginModel)Session["eTrac"];
            }
            //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;
            DateTime _fromDate = fromDate ?? clientdt.Date;
            DateTime _toDate   = toDate ?? clientdt.AddDays(1).Date;

            //maintaining flag  if interval date come then need to fetch record till midnight of todate day
            if (toDate != null)
            {
                if (toDate.Value.ToLongTimeString() == "12:00:00 AM")
                {
                    isUTCDay = false;
                }
            }
            if (_fromDate != null && _toDate != null)
            {
                ////if interval date come then need to fetch record till midnight of todate day
                if ((_fromDate.Date != _toDate.Date) && (_toDate.ToLongTimeString() == "12:00:00 AM") && isUTCDay == false)
                {
                    _toDate = _toDate.AddDays(1).Date;
                }
                if ((_fromDate.Date == _toDate.Date) && (_toDate.ToLongTimeString() == "12:00:00 AM"))
                {
                    _toDate = _toDate.AddDays(1).Date;
                }
            }
            _fromDate = _fromDate.ConvertClientTZtoUTC();
            _toDate   = _toDate.ConvertClientTZtoUTC();
            var objDetails = _IeCountingReport.GetPendingPODetailsReport(_fromDate, _toDate, VendorId);

            return(Json(objDetails, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Created By : Ashwajit Bansod
        /// Created Date : 16-OCT-2019
        /// Created For : To get VSC list to delete
        /// </summary>
        /// <returns></returns>
        public JsonResult GetListOfVSCChart()
        {
            eTracLoginModel ObjLoginModel = null;

            if (Session != null)
            {
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                }
            }
            try
            {
                var getVSCList = _IePeopleManager.GetVSCList();
                return(Json(getVSCList, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 5
0
        public ActionResult GetEmployeeAssignedWorkRequest(long LocationId, long UserID, string OrderBy, string columnName)
        {
            try
            {
                eTracLoginModel ObjLoginModel = null;
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);

                    return(Json(_IUser.GetEmployeeAssignedWorkRequest(LocationId, UserID, OrderBy, columnName)));
                }
                else
                {
                    return(Json("Session Expired !"));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 6
0
        public ActionResult EditRule(string id)
        {
            eTracLoginModel ObjLoginModel = null;

            ViewBag.AccountSection = true;
            long LocationId = 0;
            long UserId     = 0;
            var  objData    = new RuleModel();

            try
            {
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                }
                if (!string.IsNullOrEmpty(id))
                {
                    ViewBag.UpdateMode = true;
                    id = Cryptography.GetDecryptedData(id, true);
                    long _ruleId = 0;
                    long.TryParse(id, out _ruleId);
                    var _RuleModel = _IRuleManager.GetRuleDetailsById(_ruleId);
                    LocationId       = ObjLoginModel.LocationID;
                    UserId           = ObjLoginModel.UserId;
                    ViewBag.UserList = _IRuleManager.GetUserDataList(LocationId, UserId);
                    return(View("~/Areas/AdminSection/Views/Rule/Index.cshtml", _RuleModel));
                }
                else
                {
                    ViewBag.AlertMessageClass = new AlertMessageClass().Danger;
                    ViewBag.Message           = Result.DoesNotExist;
                }
            }
            catch (Exception ex)
            {
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
            }
            return(View("~/Areas/AdminSection/Views/Rule/Index.cshtml"));
        }
Exemplo n.º 7
0
        public ActionResult OperationDashboard()
        {
            eTracLoginModel    ObjLoginModel       = null;
            long               Totalrecords        = 0;
            GlobalAdminManager _GlobalAdminManager = new GlobalAdminManager();
            var details = new LocationDetailsModel();

            if (Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
            }
            #region WO
            UserType _UserType = (WorkOrderEMS.Helper.UserType)ObjLoginModel.UserRoleId;
            if (_UserType == UserType.Administrator)
            {
                ViewBag.Location = _ICommonMethod.GetLocationByAdminId(ObjLoginModel.UserId);
            }
            else if (_UserType == UserType.Manager)
            {
                ViewBag.Location = _ICommonMethod.GetLocationByManagerId(ObjLoginModel.UserId);
            }
            else
            {
                ViewBag.Location = _ICommonMethod.GetAllLocation();
            }
            ViewBag.AssignToUserWO           = _GlobalAdminManager.GetLocationEmployeeWO(ObjLoginModel.LocationID);
            ViewBag.AssignToUser             = _GlobalAdminManager.GetLocationEmployee(ObjLoginModel.LocationID);
            ViewBag.Asset                    = _ICommonMethod.GetAssetList(ObjLoginModel.LocationID);
            ViewBag.GetAssetListWO           = _ICommonMethod.GetAssetListWO(ObjLoginModel.LocationID);
            ViewBag.UpdateMode               = false;
            ViewBag.PriorityLevel            = _ICommonMethod.GetGlobalCodeData("WORKPRIORITY");
            ViewBag.WorkRequestType          = _ICommonMethod.GetGlobalCodeData("WORKREQUESTTYPE");
            ViewBag.WorkRequestProjectTypeID = _ICommonMethod.GetGlobalCodeData("WORKREQUESTPROJECTTYPE");
            ViewBag.FacilityRequest          = _ICommonMethod.GetGlobalCodeData("FACILITYREQUESTTYPE");
            ViewBag.StateId                  = _ICommonMethod.GetStateByCountryId(1);
            #endregion WO


            return(PartialView("_OperationDashboard"));
        }
Exemplo n.º 8
0
        public JsonResult GetListOfQExpectationsForJSGrid(string _search, long?UserId, long?locationId, int?rows = 20, int?page = 1, int?TotalRecords = 10, string sord = null, string txtSearch = null, string sidx = null, string UserType = null)
        {
            eTracLoginModel ObjLoginModel = null;
            var             detailsList   = new List <PerformanceModel>();

            if (Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                if (locationId == null)
                {
                    locationId = ObjLoginModel.LocationID;
                }
            }
            if (UserType == null)
            {
                UserType = "All Users";
            }
            sord      = string.IsNullOrEmpty(sord) ? "desc" : sord;
            sidx      = string.IsNullOrEmpty(sidx) ? "Name" : sidx;
            txtSearch = string.IsNullOrEmpty(txtSearch) ? "" : txtSearch;
            long TotalRows = 0;

            try
            {
                long paramTotalRecords = 0;
                List <PerformanceModel> ITAdministratorList = _GlobalAdminManager.GetListOfExpectationsForJSGrid(ObjLoginModel.UserName, Convert.ToInt64(locationId), page, rows, sidx, sord, txtSearch, UserType, out paramTotalRecords);
                foreach (var ITAdmin in ITAdministratorList)
                {
                    ITAdmin.EMP_Photo = (ITAdmin.EMP_Photo == "" || ITAdmin.EMP_Photo == "null") ? HostingPrefix + ConstantImages.Replace("~", "") + "no-profile-pic.jpg" : HostingPrefix + ProfilePicPath.Replace("~/", "") + ITAdmin.EMP_Photo;

                    ITAdmin.EMP_EmployeeID = Cryptography.GetEncryptedData(ITAdmin.EMP_EmployeeID.ToString(), true);
                    ITAdmin.Status         = ITAdmin.Status == "S" ? "Review Submitted" : ITAdmin.Status == "Y" ? "Review Draft" : "Assessment Pending";
                    detailsList.Add(ITAdmin);
                }
            }
            catch (Exception ex)
            { return(Json(ex.Message, JsonRequestBehavior.AllowGet)); }
            return(Json(detailsList, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Created By : Ashwajit Bansod
        /// Created Date : 09-April-2019
        /// Created For : To get all form name list
        /// </summary>
        /// <returns></returns>
        public JsonResult GetPDFFormName()
        {
            eTracLoginModel ObjLoginModel = null;
            long            UserId        = 0;
            long            LocationId    = 0;

            if (Session != null && Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                if (LocationId > 0)
                {
                    LocationId = ObjLoginModel.LocationID;
                }
            }
            try
            {
                var result = _IMainPDFFormManager.GetPDFFormNameList();
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            { return(Json(ex.Message, JsonRequestBehavior.AllowGet)); }
        }
Exemplo n.º 10
0
        public JsonResult DeleteVehicle(string VehicleID)
        {
            try
            {
                eTracLoginModel ObjLoginModel = null; long loggedInUser = 0, vehicleId = 0;
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                }
                loggedInUser = (ObjLoginModel != null && ObjLoginModel.UserId > 0) ? (ObjLoginModel.UserId) : 0;
                if (!string.IsNullOrEmpty(VehicleID))
                {
                    VehicleID = Cryptography.GetDecryptedData(VehicleID, true);
                }
                vehicleId = Convert.ToInt64(VehicleID);

                Result result = _IEfleetVehicle.DeleteeFleetVehicle(vehicleId, loggedInUser, ObjLoginModel.Location);
                if (result == Result.Delete)
                {
                    ViewBag.Message           = CommonMessage.DeleteSuccessMessage();
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Success;
                }
                else if (result == Result.Failed)
                {
                    ViewBag.Message           = "Can't Delete Vehicle";
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
                }
                else
                {
                    ViewBag.Message           = CommonMessage.FailureMessage();
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;// store the failure message in tempdata to display in view.
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult NewBankAccount(int id)
        {
            ViewBag.EntryType = "A";
            try
            {
                eTracLoginModel objLoginSession = new eTracLoginModel();
                objLoginSession = (eTracLoginModel)Session["eTrac"];

                BankAccount BAcc = new BankAccount();
                ViewBag.GlobalCodes = ARS.GetGlobalCodes(0, "BANK");
                if (id > 0)
                {
                    ViewBag.EntryType = "U";
                    BAcc = ARS.GetAllBankAccount(0, 0, id).ToList().FirstOrDefault();
                }


                return(PartialView("~/Views/GlobalSettings/_AddBankAccount.cshtml", BAcc));
            }
            catch (Exception ex)
            { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error")); }
        }
Exemplo n.º 12
0
        public JsonResult GetCompanyAccountDetails(long VendorId, long OperatingCompanyId)
        {
            eTracLoginModel ObjLoginModel = null;
            long            Vendor        = 0;
            var             result        = new List <PaymentModel>();

            if (Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
            }
            try
            {
                if (VendorId > 0)
                {
                    result = _IPaymentManager.GetAccountDetails(VendorId, OperatingCompanyId);
                    if (result != null)
                    {
                        return(Json(result, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        ViewBag.Message           = CommonMessage.FailureMessage();
                        ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
                        return(Json(result, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    ViewBag.Message           = CommonMessage.FailureMessage();
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
                }
            }
            catch (Exception ex)
            {
                return(Json(ex.Message, JsonRequestBehavior.AllowGet));
            }
            //return null;
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 13
0
        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));
        }
Exemplo n.º 14
0
        public ActionResult UpdateDARDetails(DARModel objDARModel)
        {
            eTracLoginModel ObjLoginModel = null;

            try
            {
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);

                    if (objDARModel.DARId > 0)
                    {
                        objDARModel.ModifiedBy = ObjLoginModel.UserId;
                        objDARModel.ModifiedOn = DateTime.UtcNow;
                        _IDARManager.UpdateDAR(objDARModel);
                    }
                }
                return(RedirectToAction("ListDAR"));
            }
            catch (Exception ex)
            { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error")); }
        }
        //  [HttpGet]
        public ActionResult NewARRule(int id)
        {
            ViewBag.EntryType = "A";
            try
            {
                eTracLoginModel objLoginSession = new eTracLoginModel();
                objLoginSession = (eTracLoginModel)Session["eTrac"];

                ARRules ARR = new ARRules();

                if (id > 0)
                {
                    ViewBag.EntryType = "U";
                    ARR = ARS.GetAllARRules(null, null, null, null, "", null, "", id).ToList().FirstOrDefault();
                }


                return(PartialView("~/Views/GlobalSettings/_AddNewARRule.cshtml", ARR));
            }
            catch (Exception ex)
            { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error")); }
        }
Exemplo n.º 16
0
        public ActionResult SendMail()
        {
            eTracLoginModel ObjLoginModel = null;

            ViewBag.AccountSection = true;
            if (Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
            }
            try
            {
                long Location    = ObjLoginModel.LocationID;
                var  savedStatus = _ISendEmailTemplateManager.SendMailTemplate(Location);
                ViewBag.Message           = CommonMessage.SaveSuccessMessage();
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Success;
            }
            catch (Exception ex)
            {
                return(Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet));
            }
            return(RedirectToAction("CostCodeAndRule", "CostCode"));
        }
Exemplo n.º 17
0
        public ActionResult Index()
        {
            long Totalrecords = 0;
            LocationMasterModel objLocationMasterModel = null;

            try
            {
                var data = QRCInIt();
                //ViewBag.EncryptLastQRC = data.EncryptLastQRC;
                eTracLoginModel ObjLogin = (eTracLoginModel)Session["eTrac"];
                objLocationMasterModel       = _ICommonMethod.GetLocationDetailsById(ObjLogin.LocationID);
                ViewBag.EncryptLastQRC       = data.EncryptLastQRC + "," + (string.IsNullOrEmpty(objLocationMasterModel.Address2) ? ObjLogin.Location.ToString().Substring(0, 3).ToUpper() : objLocationMasterModel.Address2.ToString().Substring(0, 3).ToUpper());
                ViewBag.ItemAbberivationList = Convert.ToString(ConfigurationManager.AppSettings["ItemAbberivationList"]);
                ViewBag.PurchType            = _ICommonMethod.GetGlobalCodeDataList("PURCHASETYPE");
                ViewBag.RefreshMode          = false;
                if (ObjLogin != null && (ObjLogin.UserRoleId == Convert.ToInt64(UserType.GlobalAdmin) || ObjLogin.UserRoleId == Convert.ToInt64(UserType.ITAdministrator)))
                {
                    //ViewBag.ManagerList = _IGlobalAdmin.GetAllITAdministratorList(0, 1, 1000, "UserEmail", "asc", "", Convert.ToInt64(UserType.Manager), out Totalrecords);
                    ViewBag.LocationList      = _IGlobalAdmin.GetAllLocationNew();
                    ViewBag.AdministratorList = _IGlobalAdmin.GetAllITAdministratorList(0, 0, 1, 1000, "UserEmail", "asc", "", (UserType.Administrator).ToString(), out Totalrecords);
                }
                else if (ObjLogin != null && (ObjLogin.UserRoleId == Convert.ToInt64(UserType.Administrator)))
                {
                    ViewBag.LocationList = _IGlobalAdmin.GetAllLocationNew();
                    // ViewBag.AdministratorList = _IGlobalAdmin.GetAllITAdministratorList(0, 1, 1000, "UserEmail", "asc", "", Convert.ToInt64(UserType.Manager), out Totalrecords);

                    ViewBag.AdministratorList = _ICommonMethod.GetManagersBYLocationId(ObjLogin.LocationID);
                }
                //if (!string.IsNullOrEmpty(successCode) && successCode == "Success")
                //{
                //    ModelState.AddModelError("", "Record Saved Sucessfully.");
                //}D:\Project\eTrac\WorkOrderEMS\Views\NewAdmin\QRCView\_QRCForm.cshtml
                return(PartialView("~/Views/NewAdmin/QRCView/_QRCForm.cshtml", data));
                //return View(data);
            }
            catch (Exception ex)
            { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error")); }
        }
Exemplo n.º 18
0
        public JsonResult ApproveRejectRequisition(long Id, string Status)
        {
            eTracLoginModel ObjLoginModel = null;
            long            UserId        = 0;

            if (Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                UserId        = ObjLoginModel.UserId;
            }
            if (Id > 0 && Status != null)
            {
                var data = _IePeopleManager.ApproveRejectAction(Id, Status, UserId);
                if (data == true)
                {
                    if (Status == "A")
                    {
                        ViewBag.Message = CommonMessage.ApprovedRequisition();
                        return(Json(new { Message = ViewBag.Message }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        ViewBag.Message = CommonMessage.RejectRequisition();
                        return(Json(new { Message = ViewBag.Message }, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    ViewBag.Message = CommonMessage.FailureMessage();
                    return(Json(new { Message = ViewBag.Message }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                ViewBag.Message = CommonMessage.FailureMessage();
                return(Json(new { Message = ViewBag.Message }, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 19
0
        public ActionResult SaveDashboardWidgetSetting(string WidgetIds)
        {
            eTracLoginModel   ObjLoginModel        = null;
            AlertMessageClass ObjAlertMessageClass = new AlertMessageClass();

            try
            {
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                    long loc = Convert.ToInt64(Session["eTrac_SelectedDasboardLocationID"]);

                    var Result = _IDashboardWidgetSettingManager.UpdateDashboardWidgets(ObjLoginModel.UserId, loc, WidgetIds);
                    if (Result)
                    {
                        TempData["Message"]              = CommonMessage.UpdateSuccessMessage();
                        ViewBag.AlertMessageClass        = ObjAlertMessageClass.Success;
                        Session["eTrac_DashboardWidget"] = null;
                        Session["eTrac_DashboardWidget"] = this.GetUserDashboardWidgetRoles();
                        return(Json(Result, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        TempData["Message"]       = CommonMessage.FailureMessage();
                        ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
                        return(Json(Result, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    return(Json("Session Expired !", JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(ex.Message, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 20
0
        public ActionResult AddPunchTimerequest(Employee_PunchTimeRequestModel Model)
        {
            long            LocationId    = 0;
            eTracLoginModel ObjLoginModel = null;

            if (Session["eTrac"] != null)
            {
                ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                if (LocationId == 0)
                {
                    LocationId = ObjLoginModel.LocationID;
                }
                Model.UserId    = ObjLoginModel.UserId;
                Model.CreatedBy = ObjLoginModel.UserId;
            }

            string               SQRY = "EXEC SP_PunchTimeRequest N'" + Model.UserId + "','" + LocationId + "','" + Model.AttendanceDate.ToString("dd MMM yyyy") + "','" + Model.InTimeString + "','" + Model.OutTimeString + "', N'" + Model.Remarks + "'";
            DataTable            DT   = DBUtilities.GetDTResponse(SQRY);
            List <UserModelList> Emp  = new List <UserModelList>();

            return(PartialView("~/Views/NewAdmin/ePeople/_PunchTimeRequest.cshtml", Model));
            //return RedirectToAction("AttandanceManager", "eTime");
        }
Exemplo n.º 21
0
 public JsonResult GetEmployeeTotalWorkStatus()
 {
     try
     {
         eTracLoginModel obj_eTracLoginModel = new eTracLoginModel();
         long            UserId; long LocationId;
         if (Session["eTrac"] != null)
         {
             obj_eTracLoginModel = (eTracLoginModel)Session["eTrac"];
             UserId     = obj_eTracLoginModel.UserId;
             LocationId = Convert.ToInt64(Session["eTrac_SelectedDasboardLocationID"]);
             return(Json(_IWorkRequestAssignment.GetEmployeeTotalWorkStatus(UserId, LocationId)));
         }
         else
         {
             return(Json("Session expired!"));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 22
0
        /// <summary>Create
        /// <CreatedBy>Nagendra Upwanshi</CreatedBy>
        /// <CreatedOn>Nov-18-2014</CreatedOn>
        /// <CreatedFor>Load UI for Create New User</CreatedFor>
        /// </summary>
        /// <param name="usr"></param>
        /// <returns></returns>
        public ActionResult Index(string usr)
        {
            try
            {
                long            LocationID = 0, UserID = 0;
                eTracLoginModel obj_eTracLoginModel = new eTracLoginModel();
                if (Session["eTrac"] != null)
                {
                    obj_eTracLoginModel = (eTracLoginModel)Session["eTrac"];
                    UserID     = obj_eTracLoginModel.UserId;
                    LocationID = Convert.ToInt64(Session["eTrac_SelectedDasboardLocationID"]);
                }
                ObjectParameter    obj_ObjectParameter    = new ObjectParameter("TotalRecords", typeof(int));
                ObjectParameter    obj_ObjectParameter2   = new ObjectParameter("TotalRecords", typeof(int));
                GlobalAdminManager obj_GlobalAdminManager = new GlobalAdminManager();
                //  ViewBag.AllWorkOrder = obj_GlobalAdminManager.GetAllWorkRequestAssignment(0, 0, "GetAllWorkRequestAssignment", 1, 100000000, "WorkRequestAssignmentID", "asc", "", LocationID, obj_eTracLoginModel.UserId, DateTime.Now, DateTime.Now, "", obj_ObjectParameter).Count();
                ViewBag.AllAssignedWorkOrder = obj_GlobalAdminManager.GetAllWorkRequestAssignment(0, 0, "GetAllAssignedWorkRequest", 1, 100000000, "WorkRequestAssignmentID", "asc", "", LocationID, obj_eTracLoginModel.UserId, DateTime.Now, DateTime.Now, "", obj_ObjectParameter2).Count();

                return(View());
            }
            catch (Exception ex)
            { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error")); }
        }
Exemplo n.º 23
0
        /// <summary>
        /// Created By : Ashwajit bansod
        /// Created Date : 08-Jan-2018
        /// Created For : To get all sub category as per cateoty name
        /// </summary>
        /// <param name="CategoryListName"></param>
        /// <returns></returns>
        public JsonResult GetSubCategoryList(string CategoryListName)
        {
            eTracLoginModel objLoginSession = new eTracLoginModel();

            objLoginSession = (eTracLoginModel)Session["eTrac"];
            var data = new List <string>();

            try
            {
                if (CategoryListName != null)
                {
                    data = _ICostCode.GetSubCategoryList(CategoryListName);
                }
                else
                {
                    ViewBag.Message           = CommonMessage.CategoryNotSelected();
                    ViewBag.AlertMessageClass = ObjAlertMessageClass.Success;
                }
            }
            catch (Exception ex)
            { return(Json(ex.Message, JsonRequestBehavior.AllowGet)); }
            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 24
0
        public ActionResult _PermissionsDisplay(string id)
        {
            long                   userId;
            eTracLoginModel        ObjLoginModel           = null;
            AssignInventoryModel   objAssignInventoryModel = new AssignInventoryModel();
            PermissionDetailsModel objPermissionDetails    = new PermissionDetailsModel();

            try
            {
                if (!string.IsNullOrEmpty(id))
                {
                    id = Cryptography.GetDecryptedData(id, true);
                }
                userId = Convert.ToInt64(id);


                if (Session["eTrac"] != null)
                {
                    if (Session != null)
                    {
                        ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                        long locationId = (long)Session["eTrac_SelectedDasboardLocationID"];
                        objPermissionDetails.GetAssignedPermission = _ICommonMethod.GetAssignPermission(Convert.ToInt32(userId), locationId);
                        //objPermissionDetails.GetPermission = _ICommonMethod.GetAllPermissions(locationId);

                        objPermissionDetails.GetPermission = _ICommonMethod.GetPermissionsWithFilterByUserTypeLocationId(locationId, Convert.ToInt32(userId));
                        objPermissionDetails.UserIdToSave  = userId;
                    }
                }

                return(PartialView("_Permissions", objPermissionDetails));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 25
0
        public ActionResult EditeFleetPM(string id)
        {
            eTracLoginModel ObjLoginModel = null;

            try
            {
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                }

                if (!string.IsNullOrEmpty(id))
                {
                    ViewBag.UpdateMode = true;
                    id = Cryptography.GetDecryptedData(id, true);
                    long _vehicleid = 0;
                    long.TryParse(id, out _vehicleid);
                    var _eFleetPMModel = _IEfleetPM.GeteFleetPMDetailsById(_vehicleid);
                    ViewBag.VehicleNumber = _IEfleetPM.GetAllVehicleNumber();
                    ViewBag.MeterList     = _IEfleetPM.GetAllMeterList();
                    ViewBag.MilesValue    = _IEfleetPM.GetAllMilesValue();
                    ViewBag.Category      = _IEfleetPM.GetAllCategory();
                    return(View("CreateeFleetPM", _eFleetPMModel));
                }
                else
                {
                    ViewBag.AlertMessageClass = new AlertMessageClass().Danger;
                    ViewBag.Message           = Result.DoesNotExist;
                }
            }
            catch (Exception ex)
            {
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
            }
            return(View("CreateeFleetPM"));
        }
Exemplo n.º 26
0
        public ActionResult EditDriver(string id)
        {
            eTracLoginModel   ObjLoginModel        = null;
            eFleetDriverModel objeFleetDriverModel = new eFleetDriverModel();

            try
            {
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                }
                if (!string.IsNullOrEmpty(id))
                {
                    ViewBag.UpdateMode = true;
                    id = Cryptography.GetDecryptedData(id, true);
                    long _driverId = 0;
                    long.TryParse(id, out _driverId);

                    var _UserModel = _IEfleetDriver.GetDriverDetailsById(_driverId);
                    ViewBag.EmployeeList = _IEfleetDriver.GetAllEmployees();
                    ViewBag.Country      = _IEfleetDriver.GetAllcountries();
                    ViewBag.StateList    = _IEfleetDriver.GetStateByCountryID();
                    return(View("RegisterDriver", _UserModel));
                }
                else
                {
                    ViewBag.AlertMessageClass = new AlertMessageClass().Danger;
                    ViewBag.Message           = Result.DoesNotExist;
                }
            }
            catch (Exception ex)
            {
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
            }
            return(View("RegisterDriver"));
        }
Exemplo n.º 27
0
        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));
        }
Exemplo n.º 28
0
        public ActionResult EditMaintenance(string id)
        {
            eTracLoginModel ObjLoginModel = null;

            try
            {
                if (Session["eTrac"] != null)
                {
                    ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);
                }

                if (!string.IsNullOrEmpty(id))
                {
                    ViewBag.UpdateMode = true;
                    id = Cryptography.GetDecryptedData(id, true);
                    long _maintenanceid = 0;
                    long.TryParse(id, out _maintenanceid);
                    var _eFleetMaintenanceModel = _IEfleetMaintenance.GeteFleetMaintenanceDetailsById(_maintenanceid);
                    ViewBag.VehicleNumber   = _IEfleetMaintenance.GetVehicleNumber(ObjLoginModel.LocationID);
                    ViewBag.MaintenanceType = _IEfleetMaintenance.GetAllMaintenanceType();
                    // ViewBag.RemainderMetricDesc = _IEfleetMaintenance.GetAllPendingPMReminderDescription(ObjLoginModel.LocationID);
                    return(View("CreateeFleetMaintenance", _eFleetMaintenanceModel));
                }
                else
                {
                    ViewBag.AlertMessageClass = new AlertMessageClass().Danger;
                    ViewBag.Message           = Result.DoesNotExist;
                }
            }
            catch (Exception ex)
            {
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
            }
            return(View("CreateeFleetMaintenance"));
        }
Exemplo n.º 29
0
        /// <summary>
        /// Created By : Ashwajit Bansod
        /// Created Date : 24-Oct-2019
        /// Created For : To get File type list
        /// </summary>
        /// <returns></returns>
        public List <FormTypeListModel> GetFileList(eTracLoginModel obj)
        {
            var lst = new List <FormTypeListModel>();

            try
            {
                if (obj.UserId > 0)
                {
                    lst = _FillableFormRepository.GetFileList().Select(x => new FormTypeListModel()
                    {
                        FileName   = x.FLT_FileSubType,
                        FileType   = x.FLT_FileType,
                        FileTypeId = x.FLT_Id,
                        IsActive   = x.FLT_IsActive
                    }).ToList();
                }
                return(lst);
            }
            catch (Exception ex)
            {
                Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public List<FormTypeListModel> GetFormList(eTracLoginModel obj)", "Exception While getting list of files with type.", obj);
                throw;
            }
        }
        //  [HttpPost]
        public ActionResult NewBankAccountSubmit(BankAccount BAcc, string EntryType)
        {
            try
            {
                if (EntryType == "A")
                {
                    BAcc.EntryBy   = HttpContext.User.Identity.Name;
                    BAcc.EntryDate = System.DateTime.Now;
                }
                else
                {
                    BAcc.UpdateBy   = HttpContext.User.Identity.Name;
                    BAcc.UpdateDate = System.DateTime.Now;
                }

                eTracLoginModel objLoginSession = new eTracLoginModel();
                objLoginSession = (eTracLoginModel)Session["eTrac"];

                XmlDocument   xmlDoc1        = new XmlDocument();
                XmlSerializer xmlSerializer1 = new XmlSerializer(BAcc.GetType());

                using (MemoryStream xmlStream1 = new MemoryStream())
                {
                    xmlSerializer1.Serialize(xmlStream1, BAcc);
                    xmlStream1.Position = 0;
                    xmlDoc1.Load(xmlStream1);
                }
                DataTable DT = ARS.BankAccountMapping_InsertUpdate(xmlDoc1.InnerXml, EntryType);
                ViewBag.AdministratorList = null;
                ViewBag.IsPageRefresh     = false;
                return(View("~/Views/GlobalSettings/_BankAccountList.cshtml"));
                //return null;
            }
            catch (Exception ex)
            { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error")); }
        }