public WMException CreateExternalDesignFromIf(IFExtDsgnPoint twmifextdsgn_pt_obj, bool finished, DateTime timeofcreate, string oper, string asbOrEstInd)
        {
            WMException WMexcept = null;

            ///////////////////
            ////get the next Oracle WE_S_SO_EXTDSG
            ExtDesignKey key = new ExtDesignKey()
            {
                TsExtDsgn = timeofcreate, IdOper = oper
            };

            //      ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = twmifextdsgn_pt_obj.ExternalDesignTimeStamp, IdOper = twmifextdsgn_pt_obj.OperatorId };

            ///////////////////
            ////insert Points//
            //      new PointBl().CreateExternalDesign(design, design.Points, key);

            ///////////////////////
            ////insert CUs /FAC's//
            //     CreateCUsFacilityAttributes(design, key);

            CreateExternalDesignIf(twmifextdsgn_pt_obj, key);

            ///////////////////
            ////call P Driver//
            //      WMexcept = ExecutePDriver(twmifextdsgn_pt_obj, key);


            return(WMexcept);
        }
        public WMException CreateExternalDesign(Design design)
        {
            WMException WMexcept = null;

            ///////////////////
            ////get the next Oracle WE_S_SO_EXTDSG
            ExtDesignKey key = new ExtDesignKey()
            {
                TsExtDsgn = DateTime.Now, IdOper = design.IDOper
            };

            // TODO: Add an insert to the design table
            //   twmDesignRepository.Insert(null);

            ///////////////////
            ////insert Points//
            new PointBl().CreateExternalDesign(design, design.Points, key);

            ///////////////////////
            ////insert CUs /FAC's//
            CreateCUsFacilityAttributes(design, key);

            ///////////////////
            ////call P Driver//
            WMexcept = ExecutePDriver(design, key);

            return(WMexcept);
        }
        public WMException CallExternalDesign(IFExtDsgnPoint twmifextdsgn_pt_obj, bool finished, DateTime timeofcreate, string oper, string asbOrEstInd)
        {
            WMException  WMexcept = null;
            ExtDesignKey key      = new ExtDesignKey()
            {
                TsExtDsgn = timeofcreate, IdOper = oper
            };

            WMexcept = ExecutePDriver(twmifextdsgn_pt_obj, key, asbOrEstInd);


            return(WMexcept);
        }
        private WMException CreateWMException(ObjectParameter v_fg_error
                                              , ObjectParameter v_cd_seq_error
                                              , ObjectParameter v_cd_sqlcode
                                              , ObjectParameter v_nm_interface
                                              , ObjectParameter v_ts_error
                                              , ObjectParameter v_txt_sqlerrtext
                                              , ObjectParameter v_txt_iferror
                                              , ObjectParameter v_cd_seq_error_run
                                              , ObjectParameter v_cd_district
                                              , ObjectParameter v_cd_workpacket
                                              , ObjectParameter v_cd_crew
                                              , ObjectParameter v_cd_project
                                              , ObjectParameter v_id_empl
                                              , ObjectParameter v_cd_fleet
                                              , ObjectParameter v_nm_table
                                              , ObjectParameter v_nm_column
                                              , ObjectParameter v_fg_data_error
                                              , ObjectParameter v_ts_error_logged)
        {
            WMException wme = new WMException();

            // TODO make sure these "null" should not be string.empty
            wme.cd_seq_error     = v_cd_seq_error.Value.ToString() == "null" ? 0 : int.Parse(v_cd_seq_error.Value.ToString());
            wme.cd_sqlcode       = v_cd_sqlcode.Value.ToString() == "null" ? 0 : int.Parse(v_cd_sqlcode.Value.ToString());
            wme.txt_iferror      = v_nm_interface.Value.ToString();
            wme.ts_error         = Convert.ToDateTime(v_ts_error.Value.ToString());
            wme.txt_sqlerrtext   = v_txt_sqlerrtext.Value.ToString();
            wme.txt_iferror      = v_txt_iferror.Value.ToString();
            wme.cd_seq_error_run = v_cd_seq_error_run.Value.ToString() == string.Empty ? 0 : int.Parse(v_cd_seq_error_run.Value.ToString());
            ////wme. = cmd.Parameters["v_cd_district"].Value.ToString();
            ////wme.cd_wr = int.Parse(cmd.Parameters["v_cd_workrequest"].Value.ToString());
            wme.cd_workpacket = v_cd_workpacket.Value.ToString() == string.Empty ? 0 : int.Parse(v_cd_workpacket.Value.ToString());
            wme.cd_project    = v_cd_project.Value.ToString();
            wme.cd_crew       = v_cd_crew.Value.ToString();
            ////wme. = cmd.Parameters["v_id_empl"].Value.ToString();
            wme.cd_fleet      = v_cd_fleet.Value.ToString();
            wme.nm_table      = v_nm_table.Value.ToString();
            wme.nm_column     = v_nm_column.Value.ToString();
            wme.fg_data_error = v_fg_data_error.Value.ToString();
            if (v_ts_error_logged.Value.ToString() == string.Empty)
            {
                wme.ts_error_logged = null;
            }
            else
            {
                Convert.ToDateTime(v_ts_error_logged.Value.ToString());
            }

            return(wme);
        }
        private WMException ExecutePDriver(Design design, ExtDesignKey key)
        {
            WMException wme = null;

            DesignError error = unitOfWork.DesignRepo.Insert(MapObjectToEntity(design), key.TsExtDsgn, key.IdOper);

            if (error != null)
            {
                wme = CreateWMException(error.v_fg_error
                                        , error.v_cd_seq_error
                                        , error.v_cd_sqlcode
                                        , error.v_nm_interface
                                        , error.v_ts_error
                                        , error.v_txt_sqlerrtext
                                        , error.v_txt_iferror
                                        , error.v_cd_seq_error_run
                                        , error.v_cd_district
                                        , error.v_cd_workpacket
                                        , error.v_cd_crew
                                        , error.v_cd_project
                                        , error.v_id_empl
                                        , error.v_cd_fleet
                                        , error.v_nm_table
                                        , error.v_nm_column
                                        , error.v_fg_data_error
                                        , error.v_ts_error_logged);
            }



            //TODO: create the multispeak library and put all of this there
            if (wme == null)
            {
                //////if success set the 211 to Complete
                ////new MilestoneRequirementBl(dbManagerBase.iOrigin, dbManagerBase.iEnvironment).SetRequirementStatus("211", design.WorkRequestID, "C");
                //////set the 491 Required
                ////new MilestoneRequirementBl(dbManagerBase.iOrigin, dbManagerBase.iEnvironment).SetRequirementStatus("491", design.WorkRequestID, "R");

                //TODO: create the multispeak library
                //get Approval Queue
                //WorkRequest wr = new WorkRequestBl(dbManagerBase.iOrigin, dbManagerBase.iEnvironment).GetWorkRequest(Int32.Parse(design.WorkRequestID));
                //MultiSpeakType mst = new MultiSpeakTypeDal().GetMultiSpeakTypeByWorkRequest(wr, Active.Yes);

                //TODO: create the multispeak library
                //set 491 Responsible to the correct Approval Queue
                //new MilestoneRequirementBl(dbManagerBase.iOrigin, dbManagerBase.iEnvironmentType).SetRequirementOperator("491", design.WorkRequestID.ToString(), mst.StormsApprovalQueue, "XXGEO_DO");
            }

            return(wme);
        }
Esempio n. 6
0
        public WMException CreateExternalDesignFromIf(IFExtDsgnCU twmifextdsgn_cu_obj, DateTime timeOfCreate, string oper, string asbOrEstInd)
        {
            WMException  WMexcept = null;
            ExtDesignKey key      = new ExtDesignKey()
            {
                TsExtDsgn = timeOfCreate, IdOper = oper
            };

            //   foreach (IFExtDsgnCU cuIf in twmifextdsgn_cu_objs)
            //  {


            ///////////////////
            ////get the next Oracle WE_S_SO_EXTDSG
            //  ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = DateTime.Now, IdOper = twmifextdsgn_pt_obj.OperatorId };
            //   ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = twmifextdsgn_cu_objs[0].ExternalDesignTimeStamp, IdOper = twmifextdsgn_cu_objs[0].OperatorId };


            ///////////////////
            ////insert Points//
            //      new PointBl().CreateExternalDesign(design, design.Points, key);

            ///////////////////////
            ////insert CUs /FAC's//
            //     CreateCUsFacilityAttributes(design, key);

            key.ExtDsgnFacAttSeq = null;
            if (twmifextdsgn_cu_obj.IfExtDsgnFacAtt != null && twmifextdsgn_cu_obj.IfExtDsgnFacAtt.Count > 0)
            {
                key.ExtDsgnFacAttSeq = (int)GetIfSequenceNo();
            }

            CreateExternalDesignCuIf(twmifextdsgn_cu_obj, key);

            CreateFacilityAttributes(twmifextdsgn_cu_obj, key);
            //    }

            ///////////////////
            ////call P Driver//
            //    WMexcept = ExecutePDriver(twmifextdsgn_cu_obj, key);


            return(WMexcept);
        }
        private WMException ExecutePDriver(IFExtDsgnPoint ifpoint, ExtDesignKey key, string asbOrEstInd)
        {
            WMException wme = null;

            DesignIfError error = unitOfWork.IfExtDsgnPtRepo.Insert(MapObjectToIfEntity(ifpoint), asbOrEstInd);

            if (error != null)
            {
                wme = CreateWMException(error.v_fg_error
                                        , error.v_cd_seq_error
                                        , error.v_cd_sqlcode
                                        , error.v_nm_interface
                                        , error.v_ts_error
                                        , error.v_txt_sqlerrtext
                                        , error.v_txt_iferror
                                        , error.v_cd_seq_error_run
                                        , error.v_cd_district
                                        , error.v_cd_workpacket
                                        , error.v_cd_crew
                                        , error.v_cd_project
                                        , error.v_id_empl
                                        , error.v_cd_fleet
                                        , error.v_nm_table
                                        , error.v_nm_column
                                        , error.v_fg_data_error
                                        , error.v_ts_error_logged);
            }



            if (wme == null)
            {
            }

            return(wme);
        }