Exemple #1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (cbCustomer.Text == string.Empty)
            {
                DrawingPropertySet.SwApp.SendMsgToUser2(Properties.Resources.CustomerEmpty,
                                                        (int)swMessageBoxIcon_e.swMbStop,
                                                        (int)swMessageBoxBtn_e.swMbOk);
            }
            else if (cbItemNo.Text == string.Empty)
            {
                DrawingPropertySet.SwApp.SendMsgToUser2(Properties.Resources.ItemNumberEmpty,
                                                        (int)swMessageBoxIcon_e.swMbStop,
                                                        (int)swMessageBoxBtn_e.swMbOk);
            }
            else if (cbDescription.Text.Length > 50)
            {
                DrawingPropertySet.SwApp.SendMsgToUser2(Properties.Resources.CutlistDescriptionTooLong,
                                                        (int)swMessageBoxIcon_e.swMbStop,
                                                        (int)swMessageBoxBtn_e.swMbOk);
            }
            else
            {
                string[] clData = cbItemNo.Text.Split(new string[] { "REV" }, StringSplitOptions.None);
                if (clData.Length > 1)
                {
                    if (CutlistData.GetCutlistID(clData[0].Trim(), clData[1].Trim()) > 0)
                    {
                        UpdateCutlist(clData[0].Trim(), clData[1].Trim());
                    }
                }
                else
                {
                    UpdateCutlist(cbItemNo.Text, cbRev.Text);
                }

                if (mde != null)
                {
                    mde.SetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalDisplay,
                                                 (int)swUserPreferenceOption_e.swDetailingNoOptionSpecified, fracdisp);
                    mde.SetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalPlaces,
                                                 (int)swUserPreferenceOption_e.swDetailingNoOptionSpecified, decs);
                    mde.SetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalDisplay,
                                                 (int)swUserPreferenceOption_e.swDetailingNoOptionSpecified, decd);
                    md.ForceRebuild3(false);
                }

                if (Properties.Settings.Default.MakeSounds)
                {
                    System.Media.SystemSounds.Beep.Play();
                }

                Close();
            }
        }
Exemple #2
0
        /// <summary>
        /// Remove part from particular cutlist.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bRemove_Click(object sender, EventArgs e)
        {
            string[] cl = cbCutlist.Text.Split(new string[] { "REV" }, StringSplitOptions.None);
            if (cl.Length > 1)
            {
                int clid = cd.GetCutlistID(cl[0].Trim(), cl[1].Trim());
                if (cd.RemovePartFromCutlist(clid, propertySet) > 0)
                {
                    UpdateCutlistBox();
                }
            }

            if (Properties.Settings.Default.MakeSounds)
            {
                System.Media.SystemSounds.Beep.Play();
            }
        }