Exemple #1
0
        public ActionResult RigAdminListsPartial()
        {
            RigAdminManageModel manageRigModel = (RigAdminManageModel)Session["manageRigModel"];

            IIrmaServiceDataModel emailDataModel = IrmaServiceSystem.GetServiceModel(IrmaConstants.IrmaPobModels.Emails);
            PobEmailModel         pobEmail       = emailDataModel.GetItem(string.Format("Name=\"PobSummaryReport\""), "Name");
            PobEmailModel         dailyEmail     = emailDataModel.GetItem(string.Format("Name=\"DailySummaryReport\""), "Name");

            char[] sep = { ';' };
            manageRigModel.MaxPOB                = IrmaServiceSystem.GetMaxPOB();
            manageRigModel.DateFormat            = UtilitySystem.Settings.ConfigSettings["DateFormat"];
            manageRigModel.DateTimeFormat        = UtilitySystem.Settings.ConfigSettings["DateTimeFormat"];
            manageRigModel.PobSummaryEmailList   = (pobEmail != null && pobEmail.Recipients != null) ? pobEmail.Recipients.Split(sep) : null;
            manageRigModel.DailySummaryEmailList = (dailyEmail != null && dailyEmail.Recipients != null) ? dailyEmail.Recipients.Split(sep) : null;

            // Phase 1 Parameters
            string val = IrmaServiceSystem.GetAdminCustomValue("EmailTime");

            manageRigModel.EmailTime = (val != null) ? DateTime.Parse(val) : DateTime.Now;

            val = IrmaServiceSystem.GetAdminCustomValue("Brazil");
            manageRigModel.IsRigInBrazil = (val != null && val == "1") ? true : false;
            val = IrmaServiceSystem.GetAdminCustomValue("RequireClientSignature");
            manageRigModel.ChooseClientSignAtTimeOfPermit = (val != null && val == "1") ? true : false;
            val = IrmaServiceSystem.GetAdminCustomValue("ClientHotWork");
            manageRigModel.IsClientRequireSignHotWorkPermit = (val != null && val == "1") ? true : false;
            val = IrmaServiceSystem.GetAdminCustomValue("ClientColdWork");
            manageRigModel.IsClientRequireSignColdWorkPermit = (val != null && val == "1") ? true : false;
            val = IrmaServiceSystem.GetAdminCustomValue("ClientConfinedSpace");
            manageRigModel.IsClientRequireSignConfinedWorkPermit = (val != null && val == "1") ? true : false;
            val = IrmaServiceSystem.GetAdminCustomValue("OIM");
            UserModel userOIM = ServiceSystem.GetUserFromPassport(val.Trim());

            manageRigModel.CurrentOIM = userOIM.Id;
            val = IrmaServiceSystem.GetAdminCustomValue("Master");
            UserModel userMaster = ServiceSystem.GetUserFromPassport(val.Trim());

            if (userMaster != null)
            {
                manageRigModel.CurrentMaster = userMaster.Id;
            }

            Session["manageRigModel"] = manageRigModel;
            return(PartialView("RigAdminListsPartial", manageRigModel));
        }
Exemple #2
0
        public ActionResult CapBookReport(string passportId)
        {
            CAP_BookReportModel model = new CAP_BookReportModel();

            model.CapBookEnscoLogo = HttpContext.Server.MapPath("~/Images/CapEnscoLogo.png");
            model.CapBookImage1    = HttpContext.Server.MapPath("~/Images/CapBook1.png");
            model.CapBookImage2    = HttpContext.Server.MapPath("~/Images/CapBook2.png");
            model.CapBookTlcLogo   = HttpContext.Server.MapPath("~/Images/TlcLogo.png");

            model.CapBookPage1  = HttpContext.Server.MapPath("~/Images/CapBookPage1.png");
            model.CapBookPage2  = HttpContext.Server.MapPath("~/Images/CapBookPage2.png");
            model.CapBookPage3  = HttpContext.Server.MapPath("~/Images/CapBookPage3.png");
            model.CapBookPage4  = HttpContext.Server.MapPath("~/Images/CapBookPage4.png");
            model.CapBookPage5  = HttpContext.Server.MapPath("~/Images/CapBookPage5.png");
            model.CapBookPage6  = HttpContext.Server.MapPath("~/Images/CapBookPage6.png");
            model.CapBookPage7  = HttpContext.Server.MapPath("~/Images/CapBookPage7.png");
            model.CapBookPage8  = HttpContext.Server.MapPath("~/Images/CapBookPage8.png");
            model.CapBookPage9  = HttpContext.Server.MapPath("~/Images/CapBookPage9.png");
            model.CapBookPage10 = HttpContext.Server.MapPath("~/Images/CapBookPage10.png");

            // Get User Information
            LookupListModel <dynamic> lkpPosition = LookupListSystem.GetLookupList("Position");
            LookupListModel <dynamic> lkpDept     = LookupListSystem.GetLookupList("Department");
            LookupListModel <dynamic> lkpBU       = LookupListSystem.GetLookupList("BusinessUnit");

            UserModel user = ServiceSystem.GetUserFromPassport(passportId);

            model.Passport     = passportId;
            model.Name         = user.DisplayName;
            model.Position     = (string)lkpPosition.GetDisplayValue(user.Position);
            model.Department   = (string)lkpPosition.GetDisplayValue(user.Department);
            model.BusinessUnit = (string)lkpPosition.GetDisplayValue(user.BusinessUnit);
            model.RigFacility  = UtilitySystem.Settings.RigName;
            if (user.Manager != null)
            {
                UserModel manager = ServiceSystem.GetUser((int)user.Manager);
                if (manager != null)
                {
                    model.Supervisor = manager.DisplayName;
                }
            }
            model.OIM = IrmaServiceSystem.GetAdminCustomValue("OIMName");

            CapBookReport report = new CapBookReport();

            RigCapService RigCapService             = new RigCapService();
            IQueryable <CAP_BookModel> capBookItems = RigCapService.GetCAPBookQueryable().Where(x => x.EnscoPassportNo == passportId).OrderBy(x => x.CompId);
            int           compNo   = 1;
            int           ksaNo    = 1;
            CAP_BookModel lastItem = null;

            foreach (CAP_BookModel item in capBookItems)
            {
                if (lastItem != null)
                {
                    if (lastItem.CompId != item.CompId)
                    {
                        compNo++;
                        ksaNo = 0;
                    }
                    ksaNo++;
                }
                item.CompetencyNumber = string.Format("{0}.0", compNo);
                item.KSANumber        = string.Format("{0}.{1}", compNo, ksaNo);

                model.Items.Add(item);

                lastItem = (lastItem == null || lastItem.CompId != item.CompId) ? item : lastItem;
            }
            List <CAP_BookReportModel> list = new List <CAP_BookReportModel>();

            list.Add(model);
            report.DataSource = list;

            Session["currentReport"] = report;

            return(RedirectToAction("ShowReport", "Report"));
        }