예제 #1
0
 private void ShowCutlistHeaderInfo(CutlistHeaderInfo c)
 {
     try {
         c.ShowDialog();
     } catch (ObjectDisposedException odex) {
         // Failed to initiate.
         // Usually, it closed itself because no table was found.
     } catch (Exception ex) {
         _swApp.SendMsgToUser2(ex.Message,
                               (int)swMessageBoxIcon_e.swMbStop,
                               (int)swMessageBoxBtn_e.swMbOk);
     }
 }
예제 #2
0
        /// <summary>
        /// Add/Update a cutlist.
        /// </summary>
        /// <param name="sender">Who clicked?</param>
        /// <param name="e">Any args?</param>
        private void button1_Click(object sender, EventArgs e)
        {
            string descr = get_description(Redbrick.GetFirstView(_swApp));

            if (comboBox1.SelectedItem == null)
            {
                CutlistHeaderInfo chi = new CutlistHeaderInfo(PropertySet, descr, _swApp);
                ShowCutlistHeaderInfo(chi);
            }
            else
            {
                CutlistHeaderInfo chi = new CutlistHeaderInfo(PropertySet, descr, (int)comboBox1.SelectedValue, _swApp);
                ShowCutlistHeaderInfo(chi);
            }

            FillBoxes();
        }
예제 #3
0
        /// <summary>
        /// Pop up the CutlistHeaderInfo form.
        /// </summary>
        private void AddToCutlist()
        {
            string question          = string.Format(Properties.Resources.AddToExistingCutlist, propertySet.PartName);
            swMessageBoxResult_e res = (swMessageBoxResult_e)propertySet.SwApp.SendMsgToUser2(question,
                                                                                              (int)swMessageBoxIcon_e.swMbQuestion,
                                                                                              (int)swMessageBoxBtn_e.swMbYesNoCancel);

            switch (res)
            {
            case swMessageBoxResult_e.swMbHitAbort:
                break;

            case swMessageBoxResult_e.swMbHitCancel:
                break;

            case swMessageBoxResult_e.swMbHitIgnore:
                break;

            case swMessageBoxResult_e.swMbHitNo:
                CutlistHeaderInfo chin = new CutlistHeaderInfo(CutlistData.MakePartFromPropertySet(propertySet, Convert.ToUInt16(nudQ.Value)),
                                                               propertySet.cutlistData, CutlistHeaderInfo.CutlistFunction.CreateNew);
                chin.Text = "Creating new cutlist...";
                chin.ShowDialog();
                break;

            case swMessageBoxResult_e.swMbHitOk:
                break;

            case swMessageBoxResult_e.swMbHitRetry:
                break;

            case swMessageBoxResult_e.swMbHitYes:
                CutlistHeaderInfo chiy = new CutlistHeaderInfo(CutlistData.MakePartFromPropertySet(propertySet, Convert.ToUInt16(nudQ.Value)),
                                                               propertySet.cutlistData, CutlistHeaderInfo.CutlistFunction.AddToExistingNotSelected);
                chiy.Text = "Adding to cutlist...";
                chiy.ShowDialog();
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// Pop up the CutlistHeaderInfo form.
 /// </summary>
 private void AddToCutlist()
 {
     string question = string.Format(Properties.Resources.AddToExistingCutlist, propertySet.PartName);
       swMessageBoxResult_e res = (swMessageBoxResult_e)propertySet.SwApp.SendMsgToUser2(question,
     (int)swMessageBoxIcon_e.swMbQuestion,
     (int)swMessageBoxBtn_e.swMbYesNoCancel);
       switch (res) {
     case swMessageBoxResult_e.swMbHitAbort:
       break;
     case swMessageBoxResult_e.swMbHitCancel:
       break;
     case swMessageBoxResult_e.swMbHitIgnore:
       break;
     case swMessageBoxResult_e.swMbHitNo:
       CutlistHeaderInfo chin = new CutlistHeaderInfo(CutlistData.MakePartFromPropertySet(propertySet, Convert.ToUInt16(nudQ.Value)),
     propertySet.cutlistData, CutlistHeaderInfo.CutlistFunction.CreateNew);
       chin.Text = "Creating new cutlist...";
       chin.ShowDialog();
       break;
     case swMessageBoxResult_e.swMbHitOk:
       break;
     case swMessageBoxResult_e.swMbHitRetry:
       break;
     case swMessageBoxResult_e.swMbHitYes:
     CutlistHeaderInfo chiy = new CutlistHeaderInfo(CutlistData.MakePartFromPropertySet(propertySet, Convert.ToUInt16(nudQ.Value)),
       propertySet.cutlistData, CutlistHeaderInfo.CutlistFunction.AddToExistingNotSelected);
     chiy.Text = "Adding to cutlist...";
     chiy.ShowDialog();
       break;
     default:
       break;
       }
 }
예제 #5
0
        /// <summary>
        /// Add/Update a cutlist.
        /// </summary>
        /// <param name="sender">Who clicked?</param>
        /// <param name="e">Any args?</param>
        private void button1_Click(object sender, EventArgs e)
        {
            string descr = get_description(Redbrick.GetFirstView(_swApp));
              CutlistHeaderInfo chi = new CutlistHeaderInfo(PropertySet, descr, _swApp);
              try {
            chi.ShowDialog();
              } catch (ObjectDisposedException odex) {
            // Failed to initiate.
            // Usually, it closed itself because no table was found.
              } catch (Exception ex) {
            _swApp.SendMsgToUser2(ex.Message,
              (int)swMessageBoxIcon_e.swMbStop,
              (int)swMessageBoxBtn_e.swMbOk);
              }

              FillBoxes();
        }