Beispiel #1
0
        public DialogResult CheckOutPart(IEdmVault7 vault, EdmCmdData file)
        {
            object partnum_val;

            IEdmFile5 part = (IEdmFile5)vault.GetObject(EdmObjectType.EdmObject_File, file.mlObjectID1);

            IEdmEnumeratorVariable5 var = part.GetEnumeratorVariable();

            string selected_config = DetermineConfig(part, vault, file, "");

            var.GetVar("Number", selected_config, out partnum_val);

            if (selected_config != "")
            {
                CheckOut_Master CM = new CheckOut_Master(partnum_val.ToString());

                CM.ShowDialog();

                return CM.DialogResult;
            }
            else
                return DialogResult.Cancel;
        }
        public Bill_Master(string ParentNumber, string Rev)
        {
            InitializeComponent();

            BillDataGrid.AutoGenerateColumns = false;

            gid_txt.Text = Properties.Settings.Default.ecogroup;

            parentrev_txt.Text = Rev;

            partnum_txt.Leave += partnum_txt_Leave;

            mtlseq_txt.Text = GetNextSeq().ToString();

            parent_txt.Text = ParentNumber;

            try
            {
                EngWBDS = EngWB.GetDatasetForTree(gid_txt.Text, parent_txt.Text, parentrev_txt.Text, "", null, false, false);

                BillDataGrid.DataSource = EngWBDS.Tables["ECOMtl"];
            }
            catch
            {
                try
                {
                    MessageBox.Show("You must check part out before continuing.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Hand);

                    CheckOut_Master CO_M = new CheckOut_Master(parent_txt.Text);

                    DialogResult dr = CO_M.ShowDialog();

                    if (dr != DialogResult.Cancel)
                    {
                        EngWBDS = EngWB.GetDatasetForTree(gid_txt.Text, parent_txt.Text, parentrev_txt.Text, "", null, false, false);

                        BillDataGrid.DataSource = EngWBDS.Tables["ECOMtl"];
                    }
                    else
                        this.Close();
                }
                catch (Exception ex1) { MessageBox.Show(ex1.Message + "\n\nThis process will now close", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); }
            }

            #region Fill Operations

            EngWBDS.Tables["ECOOpr"].Columns.Add("FullCode", typeof(string), "OprSeq + ' - ' + OpDesc");

            ops_cbo.DataSource = EngWBDS.Tables["ECOOpr"];

            ops_cbo.DisplayMember = "FullCode";

            ops_cbo.ValueMember = "OprSeq";

            ops_cbo.SelectedValue = "10";

            #endregion

            UpdateParentDesc();

            EnableItemDetails();

            this.FormClosing += Bill_Master_FormClosing;

            //Setbill(BillParts, BillQty);
        }
        public Bill_Master(List<BillItem>Bill , string ParentNumber, string Rev, decimal weight_val, decimal area_val)
        {
            try
            {
                InitializeComponent();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }

            try
            {
                weight.Value = weight_val;

                area.Value = area_val;
            }
            catch { }

            BillDataGrid.AutoGenerateColumns = false;

            gid_txt.Text = Properties.Settings.Default.ecogroup;

            if (Rev == "")
                parentrev_txt.Text = DataList.GetCurrentRev(ParentNumber);
            else
                parentrev_txt.Text = Rev;

            partnum_txt.Leave += partnum_txt_Leave;

            mtlseq_txt.Text = GetNextSeq().ToString();

            parent_txt.Text = ParentNumber;

            try
            {
                EngWBDS = EngWB.GetDatasetForTree(gid_txt.Text, parent_txt.Text, parentrev_txt.Text, "", null, false, false);

                BillDataGrid.DataSource = EngWBDS.Tables["ECOMtl"];
            }
            catch
            {
                try
                {
                    MessageBox.Show("You must check part out before continuing.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Hand);

                    CheckOut_Master CO_M = new CheckOut_Master(parent_txt.Text);

                    DialogResult dr = CO_M.ShowDialog();

                    if (dr != DialogResult.Cancel)
                    {
                        EngWBDS = EngWB.GetDatasetForTree(gid_txt.Text, parent_txt.Text, parentrev_txt.Text, "", null, false, false);

                        BillDataGrid.DataSource = EngWBDS.Tables["ECOMtl"];
                    }
                    else
                        this.Close();
                }
                catch (Exception ex1) {MessageBox .Show (ex1.Message + "\n\nThis process will now close","Error!",MessageBoxButtons.OK,MessageBoxIcon.Error); }
            }

            this.FormClosing += Bill_Master_FormClosing;

            BW.RunWorkerAsync(Bill);

            try
            {
                BWForm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message,"Bill Master Error!",MessageBoxButtons.OK,MessageBoxIcon.Error);

                BWForm.Dispose();

                BWForm = new Waiting("Loading Bill of Materials into Epicor...");

                BWForm.ShowDialog();
            }
        }
        private void Operations_Master_Load(object sender, EventArgs e)
        {
            OPDataGrid.SelectionChanged += OPDataGrid_SelectionChanged;

            this.FormClosing += Operations_Master_FormClosing;

            ResourceTable = DataList.ResourceGroup();

            FillLaborEntryGrid();

            FillProdStd();

            EnableSNChk();

            string Message;

            bool status = !DataList.PartCheckOutStatus(Properties.Settings.Default.ecogroup, partnumber_txt.Text, rev_txt.Text, out Message);

            if (status)
            {
                string cur = DataList.GetCurrentRev(partnumber_txt.Text);

                if (rev_txt.Text == cur)
                {
                    MessageBox.Show("Revisions of Epicor and SolidWorks do not match.  Please correct this and try again.", "Stop!", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    this.Close();
                }
                else
                {
                    MessageBox.Show("Part must be checked out by selected Group ID to continue.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    CheckOut_Master CO_M = new CheckOut_Master(partnumber_txt.Text);

                    DialogResult dr = CO_M.ShowDialog();

                    if (dr == DialogResult.Cancel)
                        this.Close();
                }
            }
            else
            {
                if (Message != "Checked Out by GroupID")
                {
                    MessageBox.Show("Part must be checked out by selected Group ID to continue.\n\n" + Message, "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    this.Close();
                }
            }

            OPDataGrid.ClearSelection();

            SNRequiredOpr_chk.Click += SNRequiredOpr_chk_Click;

            try
            {
                if (OPDataGrid.Rows.Count > 0)
                    OPDataGrid.CurrentCell = OPDataGrid[0, 0];
            }
            catch{ }
        }