Пример #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));
        }