Пример #1
0
        private void ApplyChangeManagementUDA(bool Added, TSM.ModelObject obj)
        {
            Phase objPhase;

            if (Added)
            {
                int number;
                if (Int32.TryParse(txb_AddedPhase.Text, out number))
                {
                    //set object phase
                    objPhase = new Phase(number);
                    obj.SetPhase(objPhase);

                    //get phase back with full information
                    obj.GetPhase(out objPhase);

                    //save info, trim and apply to object
                    string phaseName = objPhase.PhaseName;
                    phaseName = phaseName.Trim();
                    if (phaseName.LastIndexOf(" ") > 0)
                    {
                        phaseName = phaseName.Substring(0, phaseName.LastIndexOf(" ", phaseName.Length));
                    }
                    obj.SetUserProperty("SDLT_CH_REF", phaseName);
                }
                obj.SetUserProperty("SDLT_MOD_TYPE", 1);
            }
            else
            {
                int number;
                if (Int32.TryParse(txb_DeletedPhase.Text, out number))
                {
                    //set object phase
                    objPhase = new Phase(number);
                    obj.SetPhase(objPhase);

                    //get phase back with full information
                    obj.GetPhase(out objPhase);

                    //save info, trim and apply to object
                    string phaseName = objPhase.PhaseName;
                    phaseName = phaseName.Trim();
                    if (phaseName.LastIndexOf(" ") > 0)
                    {
                        phaseName = phaseName.Substring(0, phaseName.LastIndexOf(" ", phaseName.Length));
                    }
                    obj.SetUserProperty("SDLT_CH_REF", phaseName);
                }
                obj.SetUserProperty("SDLT_MOD_TYPE", 0);
            }

            obj.SetUserProperty("SDLT_CH_TYPE", cb_ChangeType.SelectedIndex - 1);
            obj.SetUserProperty("SDLT_CH_BY_ORG", cb_RaisedBy.SelectedIndex - 1);
            obj.SetUserProperty("SDLT_CH_MODEL_BY", "ATKINS");
            obj.SetUserProperty("SDLT_CH_DATE", DateTime.Today.Date.ToString("dd'.'MM'.'yyyy"));
            obj.SetUserProperty("SDLT_CH_REV", txb_ChangeRevision.Text);
        }
Пример #2
0
 private string getPhaseNameFromReinforcement(ReinforcementBase drawingObject)
 {
     TSDrg.ReinforcementBase dwgRebar = drawingObject as TSDrg.ReinforcementBase;
     TSM.Model       MyModel          = new TSM.Model();
     TSM.ModelObject modelRebar       = MyModel.SelectModelObject(dwgRebar.ModelIdentifier);
     TSM.Phase       rebarPhase       = new TSM.Phase();
     modelRebar.GetPhase(out rebarPhase);
     return(rebarPhase.PhaseName);
 }
Пример #3
0
        private List <string> readBarInformation(ReinforcementBase dwgRebar)
        {
            List <string> info = new List <string>();

            TSM.Model       MyModel    = new TSM.Model();
            TSM.ModelObject modelRebar = MyModel.SelectModelObject(dwgRebar.ModelIdentifier);
            TSM.Phase       rebarPhase = new TSM.Phase();
            modelRebar.GetPhase(out rebarPhase);
            info.Add(rebarPhase.PhaseName);
            string shapeCode   = null;
            bool   gotProperty = modelRebar.GetReportProperty("REBAR_POS", ref shapeCode);

            info.Add(shapeCode);
            return(info);
        }