Пример #1
0
        /// <summary>
        /// Update the Redbrick. Duh.
        /// </summary>
        public void DrbUpdate()
        {
            if (dirtTracker != null)
            {
                dirtTracker.Besmirched -= dirtTracker_Besmirched;
            }

            fillMat();
            fillAuthor();
            fillCustomer();
            fillStatus();
            fillRev();
            if (Properties.Settings.Default.FilterBOM)
            {
                fillDept();
                comboBox1.Visible = true;
            }
            GetData();

            dirtTracker = new DirtTracker(this);

            if (dirtTracker != null)
            {
                IsDirty = false;
                dirtTracker.Besmirched += dirtTracker_Besmirched;
            }
        }
Пример #2
0
        public ModelRedbrick(ref SwProperties p)
        {
            props  = p;
            _swApp = p.SwApp;
            p.frm  = this.ParentForm;
            InitializeComponent();                        // MS init
            Init();                                       // my additional init
            dirtTracker             = new DirtTracker(this);
            dirtTracker.Besmirched += dirtTracker_Besmirched;
            IsDirty = false;

            s = gp.Size;
        }
Пример #3
0
        /// <summary>
        /// Write properties to drawing document.
        /// </summary>
        /// <param name="doc">The current DrawingDoc object.</param>
        public void Write(DrawingDoc doc)
        {
            if (!check_itemnumber())
            {
                string itnu = label4.Text;
                string cuss = cbCustomer.Text.Split(' ')[0];
                PropertySet.SwApp.SendMsgToUser2(
                    string.Format("The item number '{0}' possibly doesn't match the customer '{1}'.", itnu, cuss),
                    (int)swMessageBoxIcon_e.swMbWarning,
                    (int)swMessageBoxResult_e.swMbHitOk);
            }

            this.PropertySet.ReadControls();
            this.PropertySet.Write(this.SwApp);
            this.RevSet.Write(this.SwApp);
            (doc).ForceRebuild();
            this.dirtTracker = null;
        }
Пример #4
0
        /// <summary>
        /// Write properties to drawing document.
        /// </summary>
        /// <param name="md">The current ModelDoc object.</param>
        public void Write(ModelDoc2 md)
        {
            try {
                dirtTracker.Besmirched -= dirtTracker_Besmirched;
            } catch (Exception) {
                // I don't care.
            }

            if (!check_rev())
            {
                if (System.Windows.Forms.MessageBox.Show(
                        string.Format(@"Make drawing REV ({0}) match filename ({1})?", cbRevision.Text, fileRev), @"REV mismatch.", MessageBoxButtons.YesNo)
                    == DialogResult.Yes)
                {
                    cbRevision.Text = fileRev;
                    PropertySet.GetProperty("REVISION LEVEL").Value = fileRev;
                }
            }

            if (!check_itemnumber())
            {
                string itnu = label4.Text.Trim();
                string cuss = cbCustomer.Text.Split('-')[0].Trim();
                System.Windows.Forms.MessageBox.Show(
                    string.Format("The item number '{0}' doesn't match the customer '{1}'.", itnu, cuss),
                    "Wrong customer?",
                    MessageBoxButtons.OK);
            }
            this.PropertySet.ReadControls();
            this.PropertySet.Write(md);
            this.RevSet.Write(md);
            FillBoxes();
            (md as DrawingDoc).ForceRebuild();
            this.dirtTracker = null;
            dirtTracker      = new DirtTracker(this);

            if (dirtTracker != null)
            {
                IsDirty = false;
                dirtTracker.Besmirched += dirtTracker_Besmirched;
            }
        }
Пример #5
0
        /// <summary>
        /// Populate controls.
        /// </summary>
        private void GetData()
        {
            try {
            dirtTracker.Besmirched -= dirtTracker_Besmirched;
              } catch (Exception) {
            // I don't care.
              }
              PropertySet.Read();
              RevSet.Read();

              FillBoxes();

              if (Properties.Settings.Default.RememberLastCustomer && (PropertySet.GetProperty("CUSTOMER").Value == string.Empty)) {
            cbCustomer.SelectedIndex = Properties.Settings.Default.LastCustomerSelection;
              }

              dirtTracker = new DirtTracker(this);

              if (dirtTracker != null) {
            IsDirty = false;
            dirtTracker.Besmirched += dirtTracker_Besmirched;
              }
        }
Пример #6
0
 /// <summary>
 /// Write properties to drawing document.
 /// </summary>
 /// <param name="md">The current ModelDoc object.</param>
 public void Write(ModelDoc2 md)
 {
     if (!check_itemnumber()) {
     string itnu = label4.Text.Trim();
     string cuss = cbCustomer.Text.Split('-')[0].Trim();
     System.Windows.Forms.MessageBox.Show(
       string.Format("The item number '{0}' doesn't match the customer '{1}'.", itnu, cuss),
       "Wrong customer?",
       MessageBoxButtons.OK);
       }
       this.PropertySet.ReadControls();
       this.PropertySet.Write(md);
       this.RevSet.Write(md);
       FillBoxes();
       (md as DrawingDoc).ForceRebuild();
       this.dirtTracker = null;
 }
Пример #7
0
 /// <summary>
 /// Write properties to drawing document.
 /// </summary>
 /// <param name="doc">The current DrawingDoc object.</param>
 public void Write(DrawingDoc doc)
 {
     if (!check_itemnumber()) {
     string itnu = label4.Text;
     string cuss = cbCustomer.Text.Split(' ')[0];
     PropertySet.SwApp.SendMsgToUser2(
       string.Format("The item number '{0}' possibly doesn't match the customer '{1}'.", itnu, cuss),
       (int)swMessageBoxIcon_e.swMbWarning,
       (int)swMessageBoxResult_e.swMbHitOk);
       }
       this.PropertySet.ReadControls();
       this.PropertySet.Write(this.SwApp);
       this.RevSet.Write(this.SwApp);
       (doc).ForceRebuild();
       this.dirtTracker = null;
 }