Пример #1
0
        private void InitControlsWithPart(Part p, CutlistData cd)
        {
            Text = "Add to cutlist...";
            for (int i = 100; i < 100 + Properties.Settings.Default.RevNoLimit; i++)
            {
                cbRev.Items.Add(i.ToString());
            }
            cbRev.SelectedIndex = 0;
            btnCreate.Text      = "Add";
            part                   = p;
            CutlistData            = cd;
            cbRev.Enabled          = false;
            cbItemNo.DataSource    = CutlistData.GetCutlists().Tables[0];
            cbItemNo.DisplayMember = "PARTNUM";
            cbItemNo.ValueMember   = "CLID";

            cbCustomer.DataSource    = CutlistData.Customers.Tables[0];
            cbCustomer.DisplayMember = "CUSTOMER";
            cbCustomer.ValueMember   = "CUSTID";

            cbSetupBy.DataSource    = CutlistData.GetAuthors().Tables[0];
            cbSetupBy.DisplayMember = "NAME";
            cbSetupBy.ValueMember   = "UID";
            cbSetupBy.SelectedValue = CutlistData.GetCurrentAuthor();

            // Not classy, but it makes the boxes update the first time around.
            clicked        = true;
            CurrentCutlist = Properties.Settings.Default.CurrentCutlist;
            if (CurrentCutlist != 0)
            {
                cbItemNo.SelectedIndex = cbItemNo.FindString(
                    cd.GetCutlistData(CurrentCutlist).Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.PARTNUM].ToString());
            }
        }
Пример #2
0
        private void xInitControlsWithPart(Part p, CutlistData cd, string itemNo, string Rev)
        {
            for (int i = 100; i < 100 + Properties.Settings.Default.RevNoLimit; i++)
            {
                cbRev.Items.Add(i.ToString());
            }
            cbRev.SelectedIndex = 0;
            btnCreate.Text      = "Add";
            part        = p;
            CutlistData = cd;

            cbCustomer.DataSource    = CutlistData.Customers.Tables[0];
            cbCustomer.DisplayMember = "CUSTOMER";
            cbCustomer.ValueMember   = "CUSTID";

            cbSetupBy.DataSource    = CutlistData.GetAuthors().Tables[0];
            cbSetupBy.DisplayMember = "NAME";
            cbSetupBy.ValueMember   = "UID";
            cbSetupBy.SelectedValue = CutlistData.GetCurrentAuthor();

            DataSet dr = CutlistData.GetCutlistData(itemNo, Rev);

            cbCustomer.SelectedValue = int.Parse(dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.CUSTID].ToString());
            cbItemNo.Text            = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.PARTNUM].ToString();
            cbDescription.Text       = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.DESCR].ToString();
            tbL.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.LENGTH].ToString();
            tbW.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.WIDTH].ToString();
            tbH.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.HEIGHT].ToString();
            cbDrawingReference.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.DRAWING].ToString();
            cbSetupBy.SelectedValue = int.Parse(dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.SETUP_BY].ToString());
        }
Пример #3
0
        private void InitControlsWithPart(Part p, CutlistData cd, string itemNo, string Rev)
        {
            for (int i = 100; i < 100 + Properties.Settings.Default.RevNoLimit; i++)
            {
                cbRev.Items.Add(i.ToString());
            }
            cbRev.SelectedIndex = 0;
            btnCreate.Text      = "Add";
            part        = p;
            CutlistData = cd;

            cbItemNo.DataSource    = CutlistData.GetCutlists().Tables[0];
            cbItemNo.DisplayMember = "PARTNUM";
            cbItemNo.ValueMember   = "CLID";

            cbCustomer.DataSource    = CutlistData.Customers.Tables[0];
            cbCustomer.DisplayMember = "CUSTOMER";
            cbCustomer.ValueMember   = "CUSTID";
            cbCustomer.SelectedIndex = Properties.Settings.Default.LastCustomerSelection;

            cbSetupBy.DataSource    = CutlistData.GetAuthors().Tables[0];
            cbSetupBy.DisplayMember = "NAME";
            cbSetupBy.ValueMember   = "UID";
            cbSetupBy.SelectedValue = CutlistData.GetCurrentAuthor();
        }
Пример #4
0
        private void InitControlsWithDrawing()
        {
            for (int i = 100; i < 100 + Properties.Settings.Default.RevNoLimit; i++)
            {
                cbRev.Items.Add(i.ToString());
            }

            cbRev.Items.Add("NS");
            cbRev.SelectedIndex = 0;

            string[] title = (DrawingPropertySet.SwApp.ActiveDoc as ModelDoc2).GetTitle().Split(new string [] { @"REV", @".", @" " },
                                                                                                StringSplitOptions.None);
            Text = "Add/Update Cutlist for " + title[0] + "...";
            cbItemNo.DisplayMember  = "PARTNUM";
            cbItemNo.ValueMember    = "CLID";
            cbDrawingReference.Text = DrawingPropertySet.GetProperty("PartNo").ResValue;
            cbItemNo.Text           = title[0];

            cbCustomer.DataSource    = CutlistData.Customers.Tables[0];
            cbCustomer.DisplayMember = "CUSTOMER";
            cbCustomer.ValueMember   = "CUSTID";
            cbCustomer.SelectedIndex = cbCustomer.FindString(DrawingPropertySet.GetProperty("CUSTOMER").Value.Split('-')[0].Trim());

            cbSetupBy.DataSource    = CutlistData.GetAuthors().Tables[0];
            cbSetupBy.DisplayMember = "NAME";
            cbSetupBy.ValueMember   = "UID";
            cbSetupBy.SelectedValue = CutlistData.GetCurrentAuthor();
            cbRev.Text = DrawingPropertySet.GetProperty("REVISION LEVEL").Value;

            cbDescription.Text = description;
            InitTableData();
        }
        private void xInitControlsWithPart(Part p, CutlistData cd, string itemNo, string Rev)
        {
            for (int i = 100; i < 100 + Properties.Settings.Default.RevNoLimit; i++)
            cbRev.Items.Add(i.ToString());
              cbRev.SelectedIndex = 0;
              btnCreate.Text = "Add";
              part = p;
              CutlistData = cd;

              cbCustomer.DataSource = CutlistData.Customers.Tables[0];
              cbCustomer.DisplayMember = "CUSTOMER";
              cbCustomer.ValueMember = "CUSTID";

              cbSetupBy.DataSource = CutlistData.GetAuthors().Tables[0];
              cbSetupBy.DisplayMember = "NAME";
              cbSetupBy.ValueMember = "UID";
              cbSetupBy.SelectedValue = CutlistData.GetCurrentAuthor();

              DataSet dr = CutlistData.GetCutlistData(itemNo, Rev);
              cbCustomer.SelectedValue = int.Parse(dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.CUSTID].ToString());
              cbItemNo.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.PARTNUM].ToString();
              cbDescription.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.DESCR].ToString();
              tbL.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.LENGTH].ToString();
              tbW.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.WIDTH].ToString();
              tbH.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.HEIGHT].ToString();
              cbDrawingReference.Text = dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.DRAWING].ToString();
              cbSetupBy.SelectedValue = int.Parse(dr.Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.SETUP_BY].ToString());
        }
        private void InitControlsWithPart(Part p, CutlistData cd)
        {
            Text = "Add to cutlist...";
              for (int i = 100; i < 100 + Properties.Settings.Default.RevNoLimit; i++)
            cbRev.Items.Add(i.ToString());
              cbRev.SelectedIndex = 0;
              btnCreate.Text = "Add";
              part = p;
              CutlistData = cd;
              cbRev.Enabled = false;
              cbItemNo.DataSource = CutlistData.GetCutlists().Tables[0];
              cbItemNo.DisplayMember = "PARTNUM";
              cbItemNo.ValueMember = "CLID";

              cbCustomer.DataSource = CutlistData.Customers.Tables[0];
              cbCustomer.DisplayMember = "CUSTOMER";
              cbCustomer.ValueMember = "CUSTID";

              cbSetupBy.DataSource = CutlistData.GetAuthors().Tables[0];
              cbSetupBy.DisplayMember = "NAME";
              cbSetupBy.ValueMember = "UID";
              cbSetupBy.SelectedValue = CutlistData.GetCurrentAuthor();

              // Not classy, but it makes the boxes update the first time around.
              clicked = true;
              CurrentCutlist = Properties.Settings.Default.CurrentCutlist;
              if (CurrentCutlist != 0) {
            cbItemNo.SelectedIndex = cbItemNo.FindString(
              cd.GetCutlistData(CurrentCutlist).Tables[0].Rows[0][(int)CutlistData.CutlistDataFields.PARTNUM].ToString());
              }
        }
        private void InitControlsWithPart(Part p, CutlistData cd, string itemNo, string Rev)
        {
            for (int i = 100; i < 100 + Properties.Settings.Default.RevNoLimit; i++)
            cbRev.Items.Add(i.ToString());
              cbRev.SelectedIndex = 0;
              btnCreate.Text = "Add";
              part = p;
              CutlistData = cd;

              cbItemNo.DataSource = CutlistData.GetCutlists().Tables[0];
              cbItemNo.DisplayMember = "PARTNUM";
              cbItemNo.ValueMember = "CLID";

              cbCustomer.DataSource = CutlistData.Customers.Tables[0];
              cbCustomer.DisplayMember = "CUSTOMER";
              cbCustomer.ValueMember = "CUSTID";
              cbCustomer.SelectedIndex = Properties.Settings.Default.LastCustomerSelection;

              cbSetupBy.DataSource = CutlistData.GetAuthors().Tables[0];
              cbSetupBy.DisplayMember = "NAME";
              cbSetupBy.ValueMember = "UID";
              cbSetupBy.SelectedValue = CutlistData.GetCurrentAuthor();
        }