Exemple #1
0
        public ActionResult Edit(string qr)
        {
            long            Totalrecords  = 0;
            eTracLoginModel ObjLoginModel = null;

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

                if (!string.IsNullOrEmpty(qr))
                {
                    ViewBag.UpdateMode = true;
                    qr = Cryptography.GetDecryptedData(qr, true);
                    ViewBag.Country   = _ICommonMethod.GetAllcountries();
                    ViewBag.PurchType = _ICommonMethod.GetGlobalCodeDataList("PURCHASETYPE");

                    if (ObjLoginModel != null && (ObjLoginModel.UserRoleId == Convert.ToInt64(UserType.GlobalAdmin) || ObjLoginModel.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 (ObjLoginModel != null && (ObjLoginModel.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(ObjLoginModel.LocationID);
                    }

                    //QRCModel ObjQRCModel = _IQRCSetup.GetGlobalCodeForCategories();
                    QRCModel ObjQRCModel = _IQRCSetup.GetQrcById(Convert.ToInt64(qr));
                    ObjQRCModel.EncryptLastQRC = Cryptography.GetEncryptedData(ObjQRCModel.QRCId.ToString(), true);


                    ObjQRCModel.UpdateMode = true;

                    if (ObjQRCModel != null && ObjQRCModel.Allotedto != null)
                    {
                        ViewBag.LocationByAdmin = _ICommonMethod.GetLocationByAdminId(ObjQRCModel.Allotedto);
                    }

                    return(View("Index", ObjQRCModel));
                }
                else
                {
                    ViewBag.AlertMessageClass = new AlertMessageClass().Danger;
                    ViewBag.Message           = Result.DoesNotExist;
                }
            }
            catch (Exception ex)
            {
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
            }
            return(View("Index"));
        }
        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"));
        }