public ActionResult Index()
        {
            var objmodel = new VendorSetupManagementModel();

            ViewBag.AccountSection = true;
            eTracLoginModel objLoginSession = new eTracLoginModel();

            objLoginSession = (eTracLoginModel)Session["eTrac"];
            try
            {
                long CountryId = 1;
                ViewBag.Country             = _ICommonMethod.GetAllcountries();
                ViewBag.StateList           = _ICommonMethod.GetStateByCountryId(CountryId);
                ViewBag.JobTitleList        = _ICommonMethod.GetGlobalCodeData("UserJobTitle");
                ViewBag.LEAVETYPELIST       = _ICommonMethod.GetGlobalCodeData("LEAVETYPE");
                ViewBag.ClientInvoicingTerm = _IGlobalAdmin.ListClientInvoicingTerm();
                ViewBag.VendorType          = _IVendorManagement.ListVendorType();
                ViewBag.OperatingHolder     = _IGlobalAdmin.ListCompanyHolder(true);
                ViewBag.ContractType        = _IGlobalAdmin.ListContractType();
                ViewBag.PaymentModeList     = _IVendorManagement.PaymentModeList();
                ViewBag.PaymentTermList     = _IVendorManagement.PaymentTermList();
                ViewBag.CostCodeList        = _IVendorManagement.ListAllCostCode();
                ViewBag.LocationListData    = _ICommonMethod.ListAllLocation();
            }
            catch (Exception ex)
            {
                ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error"));
            }
            return(View("~/Areas/AdminSection/Views/AdminCompany/Index.cshtml", objmodel));//D:\Project\eTrac\WorkOrderEMS\Areas\AdminSection\Views\AdminCompany\CompanyView.cshtml
        }
Example #2
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 Create(string usr)
 {
     try
     {
         ViewBag.Country = _ICommonMethod.GetAllcountries();
         var _UserModel = _ICommonMethod.LoadInvitedUser(usr);
         ViewBag.JobTitleList = _ICommonMethod.GetGlobalCodeData("UserJobTitle");
         ViewBag.LocationList = _IGlobalAdmin.GetAllLocationNew();
         return(View("ITAdministrator", _UserModel));
     }
     catch (Exception ex)
     { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; return(View("Error")); }
 }
        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"));
        }
Example #4
0
        //public JsonResult GetAllAssetByWorkArea(string WorkArea)
        //{
        //    eTracLoginModel ObjLoginModel = null;
        //    if (Session["eTrac"] != null)
        //    { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); }
        //    int _WorkAreaID = 0;
        //    try
        //    {
        //        if (!string.IsNullOrEmpty(WorkArea))
        //        {
        //            int.TryParse(WorkArea, out _WorkAreaID);
        //            StateModel State = new StateModel();
        //            CommonMethodManager _CommonMethodManager = new CommonMethodManager();

        //            List<SelectListItem> lstAsset = _ICommonMethod.GetAllAssetByWorkArea(ObjLoginModel.LocationID, _WorkAreaID);
        //            return Json(lstAsset, JsonRequestBehavior.AllowGet);
        //        }
        //        else { return Json(null, JsonRequestBehavior.AllowGet); }
        //    }
        //    catch (Exception)
        //    {
        //        throw ;
        //    }

        //}


        /// <summary>GetLocationSubType
        ///
        /// </summary>
        /// <param name="LocationType"></param>
        /// <returns></returns>
        public JsonResult GetLocationSubType(string LocationType)
        {
            int _locationType = 0;

            if (!string.IsNullOrEmpty(LocationType))
            {
                int.TryParse(LocationType, out _locationType);
                GlobalCodeModel GlobalCodeList = new GlobalCodeModel();
                GlobalCodeList.GlobalCodeList = (_locationType > 0 && _locationType == 107) ? _ICommonMethod.GetGlobalCodeData("LOCATIONSUBTYPE") : null;
                return(Json(GlobalCodeList, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
        }
Example #5
0
        public ActionResult Index(QRCModel ObjQRCModel)
        {
            DARModel            objDAR;
            long                Totalrecords           = 0;
            eTracLoginModel     ObjLoginModel          = new eTracLoginModel();
            LocationMasterModel objLocationMasterModel = null;

            try
            {
                //if (ModelState.IsValid)
                if (true)
                {
                    #region login model
                    ////
                    if (Session["eTrac"] != null)
                    {
                        ObjLoginModel = (eTracLoginModel)(Session["eTrac"]);

                        // ObjQRCModel.UserModel.ProjectID = (ObjLoginModel != null && ObjLoginModel.LocationID > 0) ? (ObjLoginModel.LocationID) : 0;
                    }
                    else
                    {
                        return(RedirectToAction("Index", "Login"));
                    }
                    ///
                    #endregion login model

                    long          _qRCId = 0;
                    Result        _fnResult, result;
                    PrintQRCModel ObjPrintQRCModel;
                    CommonHelper  ObjCommonHelper = new CommonHelper();
                    string        QRCImageName    = string.Empty;
                    //string msg;
                    if (Session["ImageName"] != null)
                    {
                        ObjQRCModel.UserModel.myProfileImage = Convert.ToString(Session["ImageName"]);
                    }

                    if (ObjQRCModel.WarrantyDocument != null)
                    {
                        ObjQRCModel.WarrantyDoc = DateTime.Now.Ticks + "_" + ObjQRCModel.WarrantyDocument.FileName.Replace(" ", "");
                    }
                    if (ObjQRCModel.LOCPicture != null)
                    {
                        ObjQRCModel.LocationPicture = DateTime.Now.Ticks + "_" + ObjQRCModel.LOCPicture.FileName.Replace(" ", "");
                    }
                    if (ObjQRCModel.AssetPictureUrl != null)
                    {
                        ObjQRCModel.AssetPicture = DateTime.Now.Ticks + "_" + ObjQRCModel.AssetPictureUrl.FileName.Replace(" ", "");
                    }

                    ObjQRCModel.CreatedBy  = ObjLoginModel.UserId;
                    ObjQRCModel.LocationId = ObjLoginModel.LocationID;

                    objDAR            = new DARModel();
                    objDAR.LocationId = ObjLoginModel.LocationID;
                    objDAR.UserId     = ObjLoginModel.UserId;
                    objDAR.CreatedBy  = ObjLoginModel.UserId;
                    objDAR.CreatedOn  = DateTime.UtcNow;

                    //Added by Bhushan on 26/Oct/2016 for client has changed request for If QRC is vehicle then directly set vehicle type is Motor Vehicle and for Shuttle Bus  set vehicle type is Shuttle Bus
                    if (ObjQRCModel.QRCTYPE == Convert.ToInt64(QrcType.Vehicle))
                    {
                        ObjQRCModel.VehicleType = Convert.ToInt64(VEHICLETYPE.MotorVehicle);
                    }
                    if (ObjQRCModel.QRCTYPE == Convert.ToInt64(QrcType.ShuttleBus))
                    {
                        ObjQRCModel.VehicleType = Convert.ToInt64(VEHICLETYPE.ShuttleBus);
                    }

                    if (_IQRCSetup.ProcessQRCSetup(ObjQRCModel, out _qRCId, out _fnResult, out ObjPrintQRCModel))
                    {
                        path = Server.MapPath(path);

                        if (ObjQRCModel.WarrantyDocument != null)
                        {
                            ObjCommonHelper.UploadImage(ObjQRCModel.WarrantyDocument, path, ObjQRCModel.WarrantyDoc);
                        }
                        if (ObjQRCModel.LOCPicture != null)
                        {
                            ObjCommonHelper.UploadImage(ObjQRCModel.LOCPicture, path, ObjQRCModel.LocationPicture);
                        }
                        if (ObjQRCModel.AssetPictureUrl != null)
                        {
                            ObjCommonHelper.UploadImage(ObjQRCModel.AssetPictureUrl, path, ObjQRCModel.AssetPicture);
                        }

                        if (_fnResult == Result.Completed)
                        {
                            // Code for to get path of root directory and attach path of directory to store image

                            string RootDirectory = ConfigurationManager.AppSettings["QRCImage"];
                            RootDirectory = Server.MapPath(RootDirectory);
                            if (ObjQRCModel.QRCImageBase64 != null)
                            {
                                ObjQRCModel.QRCImageBase64 = ObjQRCModel.QRCImageBase64.Split(',')[1];
                                ObjCommonHelper.UploadQRCImage(ObjQRCModel.QRCImageBase64, RootDirectory, ObjQRCModel.QRCImage);
                            }

                            objDAR.ActivityDetails = DarMessage.SaveQRC(ObjPrintQRCModel.QRCName, ObjLoginModel.Location);
                            objDAR.TaskType        = (long)TaskTypeCategory.QRCCreation;

                            ViewBag.Message           = CommonMessage.SaveSuccessMessage();
                            ViewBag.AlertMessageClass = ObjAlertMessageClass.Success;
                            ModelState.Clear();
                            ObjQRCModel = QRCInIt();
                        }
                        else if (_fnResult == Result.UpdatedSuccessfully)
                        {
                            objDAR.ActivityDetails = DarMessage.UpdateQRC(ObjPrintQRCModel.QRCName, ObjLoginModel.Location);
                            objDAR.TaskType        = (long)TaskTypeCategory.QRCUpdate;

                            ViewBag.Message           = CommonMessage.UpdateSuccessMessage();
                            ViewBag.AlertMessageClass = ObjAlertMessageClass.Success;
                            ModelState.Clear();
                            ObjQRCModel = QRCInIt();
                        }
                        else if (_fnResult == Result.Failed)
                        {
                            ViewBag.Message           = CommonMessage.FailureMessage();
                            ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
                            // store the failure message in tempdata to display in view.
                        }

                        #region Save DAR
                        result = _ICommonMethod.SaveDAR(objDAR);
                        #endregion Save DAR
                    }
                    else
                    {
                        ViewBag.Message           = CommonMessage.DuplicateRecordMessage();
                        ViewBag.AlertMessageClass = ObjAlertMessageClass.Info;
                        // store the failure message in tempdata to display in view.
                    }
                    //ViewBag.EncryptQRC = Cryptography.GetEncryptedData(QRCDetail.QRCId.ToString(), true);

                    //ViewBag.EncryptQRC = Cryptography.GetEncryptedData(_qRCId.ToString(), true);

                    ViewBag.QRCName     = ObjQRCModel.QRCName;
                    ViewBag.SpecialNote = ObjQRCModel.SpecialNotes;

                    //ViewBag.QRCSize = QRCDetail.DefaultSize;

                    /*
                     *                  ObjPrintQRCModel = new PrintQRCModel();
                     *
                     *
                     *                  /// pull details from ObjQRCModel and plug into ObjPrintQRCModel
                     *                  ObjPrintQRCModel.QRCId = ObjQRCModel.QRCId;
                     *
                     *                  ObjPrintQRCModel.QRCName = ObjQRCModel.QRCName;
                     *                  ObjPrintQRCModel.SpecialNotes = ObjQRCModel.SpecialNotes;
                     *                  ObjPrintQRCModel.QRCTYPE = ObjQRCModel.QRCTYPECaption;
                     *                  ObjPrintQRCModel.VehicleType = ObjQRCModel.VehicleTypeCaption;
                     *                  ObjPrintQRCModel.MotorType = ObjQRCModel.MotorTypeCaption;
                     */


                    /// pull details from ObjQRCModel and plug into ObjPrintQRCModel End

                    ObjPrintQRCModel.QRCSize    = _ICommonMethod.GetGlobalCodeData("QRCSIZE");
                    ObjPrintQRCModel.EncryptQRC = Cryptography.GetEncryptedData(ObjPrintQRCModel.QRCId.ToString(), true);

                    ObjPrintQRCModel.CompanyLogo  = (ObjLoginModel != null && !string.IsNullOrEmpty(ObjLoginModel.LocationLogo)) ? (ObjLoginModel.LocationLogo) : "/";
                    ObjPrintQRCModel.CompanyImage = (ObjLoginModel != null && !string.IsNullOrEmpty(ObjLoginModel.LocationImage)) ? (ObjLoginModel.LocationImage) : "/";
                    ObjPrintQRCModel.CompanyName  = (ObjLoginModel != null && !string.IsNullOrEmpty(ObjLoginModel.Location)) ? (ObjLoginModel.Location) : "/";

                    objLocationMasterModel    = _IGlobalAdmin.GetLocationById(ObjPrintQRCModel.LocationId);
                    ObjPrintQRCModel.Location = objLocationMasterModel.LocationName;

                    //ViewBag.EncryptQRC = ObjPrintQRCModel.EncryptQRC;
                    ViewBag.EncryptQRC     = ObjPrintQRCModel.QRCIDCode;
                    ViewBag.LastEncryptQRC = ObjPrintQRCModel.QRCIDCode;// + ',' + ObjPrintQRCModel.QRCTYPEID;//This field added by Bhushan Dod  //After comma we don't need type of QRC.We need to comment .
                    ViewBag.QRCSize        = ObjPrintQRCModel.QRCSize;

                    //PrintQRCModel ObjPrintQRCModel;
                    ViewBag.QRCModel = ObjPrintQRCModel;
                }
                else
                {
                    var    errors   = ModelState.Values.SelectMany(v => v.Errors);
                    string _message = "";
                    foreach (var items in errors)
                    {
                        _message = _message + items.ErrorMessage;
                    }
                    ViewBag.Message = _message;
                    ObjQRCModel     = _IQRCSetup.GetGlobalCodeForCategories();
                }
            }
            catch (Exception ex)
            {
                WorkOrderEMS.BusinessLogic.Exception_B.Exception_B.exceptionHandel_Runtime(ex, "Exception For File Upload", path.ToString(), null);
                ViewBag.Message           = ex.Message;
                ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;
                ObjQRCModel       = _IQRCSetup.GetGlobalCodeForCategories();
                ViewBag.Country   = _ICommonMethod.GetAllcountries();
                ViewBag.PurchType = _ICommonMethod.GetGlobalCodeDataList("PURCHASETYPE");
                return(View(ObjQRCModel));
            }
            ObjQRCModel     = _IQRCSetup.GetGlobalCodeForCategories();
            ViewBag.Country = _ICommonMethod.GetAllcountries();
            // ViewBag.PurchType = _ICommonMethod.GetGlobalCodeDataList("PURCHASETYPE");
            ViewBag.PurchType   = _ICommonMethod.GetGlobalCodeDataList("PURCHASETYPE");
            ViewBag.RefreshMode = true;
            //ViewBag.EncryptLastQRC = data.EncryptLastQRC;
            //ViewBag.EncryptLastQRC = ObjQRCModel.EncryptLastQRC + "," + (string.IsNullOrEmpty(objLocationMasterModel.Address2) ? ObjLoginModel.Location.ToString().Substring(0, 3).ToUpper() : objLocationMasterModel.Address2.ToString().Substring(0, 3).ToUpper());
            //ViewBag.ItemAbberivationList = Convert.ToString(ConfigurationManager.AppSettings["ItemAbberivationList"]);

            //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", "", Convert.ToInt64(UserType.Administrator), 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);
            //}

            return(View(ObjQRCModel));
            // return RedirectToAction("Index","QRCSetup");
        }