当前位置: 首页>>代码示例>>C#>>正文


C# Part.GetByID方法代码示例

本文整理汇总了C#中Part.GetByID方法的典型用法代码示例。如果您正苦于以下问题:C# Part.GetByID方法的具体用法?C# Part.GetByID怎么用?C# Part.GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Part的用法示例。


在下文中一共展示了Part.GetByID方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TS_Click

        void TS_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem TS = (ToolStripMenuItem)sender;

            //retrieve template data
            DataTable DT = new DataTable();

            DT = Templates.GetFullTemplate(TS.Name, "BOM");

            addraw.Enabled = true;

            try
            {
                //line for each row
                foreach (DataRow Dr in DT.Rows)
                {
                    EngWB.GetNewECOMtl(EngWBDS, gid_txt.Text, parent_txt.Text, parentrev_txt.Text, "");

                    int row = EngWBDS.Tables["ECOMtl"].Rows.Count - 1;

                    EngWBDS.Tables["ECOMtl"].Rows[row]["MtlPartNum"] = Dr["PropertyValue"].ToString();

                    EngWBDS.Tables["ECOMtl"].Rows[row]["RelatedOperation"] = Dr["PropertyType"].ToString();

                    EngWBDS.Tables["ECOMtl"].Rows[row]["MtlPartNumPartDescription"] = DataList.GetCurrentDesc(Dr["PropertyValue"].ToString());

                    EngWBDS.Tables["ECOMtl"].Rows[row]["UOMCode"] = Dr["PropertyUOM"].ToString();

                    EngWBDS.Tables["ECOMtl"].Rows[row]["QtyPer"] = Dr["PropertyQty"].ToString();

                    EngWBDS.Tables["ECOMtl"].Rows[row]["ViewAsAsm"] = Dr["PropertyOptions"].ToString();

                    EngWBDS.Tables["ECOMtl"].Rows[row]["PullAsAsm"] = Dr["PropertyOptions1"].ToString();

                    if (Dr["PropertyOptions5"].ToString() != null || Dr["PropertyOptions5"].ToString() != "")
                    {
                        if (Dr["PropertyOptions5"].ToString() == "AREA")
                            EngWBDS.Tables["ECOMtl"].Rows[row]["QtyPer"] = area.Value;

                        if (Dr["PropertyOptions5"].ToString() == "WEIGHT")
                        {
                            try
                            {
                                Part Part = new Part(DataList.EpicConn);

                                PartDataSet Pdata = new PartDataSet();

                                Pdata = Part.GetByID(parent_txt.Text);

                                string Length = RailLength(Pdata.Tables["Part"].Rows[0]["PartDescription"].ToString());

                                string partnumber = Dr["PropertyValue"].ToString();

                                double density = double.Parse(sheetCoil_UsageTableAdapter.GetDensity(partnumber,"%","%","%","%").ToString());

                                double width = double.Parse(sheetCoil_UsageTableAdapter.GetWidth(partnumber, "%", "%", "%","%","%").ToString());

                                double thickness = double.Parse(sheetCoil_UsageTableAdapter.GetLength(partnumber, "%", "%", "%", "%", "%").ToString());

                                weight.Value = (decimal)(double.Parse(Length) * density * width * thickness) / 2;
                            }
                            finally
                            {
                                EngWBDS.Tables["ECOMtl"].Rows[row]["QtyPer"] = weight.Value;
                            }
                        }
                    }

                    EngWB.Update(EngWBDS);
                }

                EnableItemDetails();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }
开发者ID:virall,项目名称:EpicorIntegration,代码行数:75,代码来源:Bill_Master.cs

示例2: KeepRaw

        /// <summary>
        /// Sequence to determine if a part is a coil or a sheet based on Type
        /// </summary>
        /// <param name="PartNumber"></param>
        /// <returns>True if part is not a coil/sheet; False if part is coil/sheet</returns>
        public bool KeepRaw(string PartNumber)
        {
            Part Part = new Part(DataList.EpicConn);

            PartDataSet Pdata = new PartDataSet();

            Pdata = Part.GetByID(PartNumber);

            string Type = Pdata.Tables ["Part"].Rows[0]["ClassDescription"].ToString();

            if (Type == "INV COIL" || Type == "INV SHEET")
                return false;
            else
                return true;
        }
开发者ID:virall,项目名称:EpicorIntegration,代码行数:20,代码来源:Bill_Master.cs

示例3: savebtn_Click

        private void savebtn_Click(object sender, EventArgs e)
        {
            if (trackserial.Checked && (SerialPrefix == "" || SerialPrefix == null))
                MessageBox.Show("Cannot use null serial prefix.  Set the prefix or uncheck 'Track Serial Number'", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            else
            {
                try
                {
                    //Commit Part Changes

                    Part Part = new Part(DataList.EpicConn);

                    PartDataSet Pdata = new PartDataSet();

                    //Pdata = (PartDataSet)DL.PartSearchDataSet("");

                    string serialWarning;

                    string questionString;

                    bool multipleMatch;

                    string PartNumber = Partnumber_txt.Text;

                    DataViewRowState DRState;

                    if (!DataList.PartExists(PartNumber))
                    {
                        Part.GetPartXRefInfo(ref PartNumber, "", "", out serialWarning, out questionString, out multipleMatch);

                        Part.GetNewPart(Pdata);

                        Part.ChangePartNum(PartNumber, Pdata);

                        DRState = DataViewRowState.Added;
                    }
                    else
                    {
                        Pdata = Part.GetByID(PartNumber);

                        DRState = DataViewRowState.Unchanged;

                        #region Clear Bflush/SN Settings

                        try
                        {
                            DataList.UpdateDatum(Pdata, "Part", 0, "TrackSerialNum", false.ToString());

                            DataList.UpdateDatum(Pdata, "Part", 0, "UseMaskSeq", false.ToString());

                            DataList.UpdateDatum(Pdata, "PartPlant", 0, "PartTrackSerialNum", false.ToString());

                            DataList.UpdateDatum(Pdata, "PartPlant", 0, "BackFlush", false.ToString());

                            Part.Update(Pdata);

                            Pdata = Part.GetByID(PartNumber);
                        }
                        catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }

                        #endregion
                    }

                    Pdata = UpdateDataSet(Pdata, DRState);

                    //Add data to allow BO to create plant tables
                    try
                    {
                        Part.Update(Pdata);

                        if (bflush_chk.Checked)
                        {
                            //try to eliminate backflush if necessary
                            DataList.UpdateDatum(Pdata, "PartPlant", 0, "BackFlush", bflush_chk.Checked.ToString());
                        }
                        Part.Update(Pdata);
                    }
                    catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }

                    if (trackserial.Checked)
                    {
                        Pdata = Part.GetByID(PartNumber);

                        try
                        {
                            Part.ChangePartTrackSerialNum(trackserial.Checked, Pdata);
                        }
                        catch
                        {
                            //If the neat process fails, do it the hard way.

                            DataList.UpdateDatum(Pdata, "Part", 0, "TrackSerialNum", true.ToString());

                            DataList.UpdateDatum(Pdata, "Part", 0, "UseMaskSeq", true.ToString());

                            DataList.UpdateDatum(Pdata, "Part", 0, "SNLastUsedSeq", "");

                            Part.Update(Pdata);

                            Pdata = Part.GetByID(PartNumber);
//.........这里部分代码省略.........
开发者ID:virall,项目名称:EpicorIntegration,代码行数:101,代码来源:Item_Master.cs

示例4: UpdateFormSet

        private void UpdateFormSet(string Pnum)
        {
            trackserial.CheckedChanged -= trackserial_CheckedChanged;

            Part Part = new Part(DataList.EpicConn);

            PartDataSet Pdata = new PartDataSet();

            Pdata = Part.GetByID(Pnum);

            Description_txt.Text = Pdata.Tables["Part"].Rows[0]["PartDescription"].ToString();

            NetWeight.Value = decimal.Parse(Pdata.Tables["Part"].Rows[0]["NetWeight"].ToString());

            uomweight_cbo.SelectedValue = Pdata.Tables["Part"].Rows[0]["NetWeightUOM"].ToString();

            uom_cbo.SelectedValue = Pdata.Tables["Part"].Rows[0]["IUM"].ToString();

            class_cbo.SelectedValue = Pdata.Tables["Part"].Rows[0]["ClassID"].ToString();

            type_cbo.SelectedValue = Pdata.Tables["Part"].Rows[0]["TypeCode"].ToString();

            group_cbo.SelectedValue = Pdata.Tables["Part"].Rows[0]["ProdCode"].ToString();

            //Should set backflush flag correctly on load now.
            bflush_chk.Checked = bool.Parse(Pdata.Tables["PartPlant"].Rows[0]["Backflush"].ToString());

            trackserial.Checked = bool.Parse(Pdata.Tables[0].Rows[0]["TrackSerialNum"].ToString());

            qtybearing.Checked = bool.Parse(Pdata.Tables[0].Rows[0]["QtyBearing"].ToString());

            phantom_chk.Checked = bool.Parse(Pdata.Tables[0].Rows[0]["PhantomBOM"].ToString());

            userevision.Checked = bool.Parse(Pdata.Tables[0].Rows[0]["UsePartRev"].ToString());

            whse_cbo.DataSource = Pdata.Tables["PartWhse"];

            whse_cbo.DisplayMember = "WarehouseDescription";

            whse_cbo.ValueMember = "WarehouseCode";

            for (int i = 0; i < Pdata.Tables["PartPlant"].Rows.Count; i++)
            {
                if (Pdata.Tables["PartPlant"].Rows[i]["Plant"].ToString() == "MfgSys")
                    planner_cbo.Text = Pdata.Tables["PartPlant"].Rows[i]["PersonID"].ToString();
            }

            SerialPrefix = Pdata.Tables[0].Rows[0]["SNMaskPrefix"].ToString();

            SerialMask = Pdata.Tables[0].Rows[0]["SNMask"].ToString();

            trackserial.CheckedChanged += trackserial_CheckedChanged;
        }
开发者ID:virall,项目名称:EpicorIntegration,代码行数:53,代码来源:Item_Master.cs

示例5: GetCurrentRev

        public static string GetCurrentRev(string PartNumber)
        {
            try
            {
                Part Part = new Part(DataList.EpicConn);

                PartDataSet PartData = new PartDataSet();

                PartData = Part.GetByID(PartNumber);

                int LastRowIndex = PartData.Tables["PartRev"].Rows.Count - 1;

                string PartRev = PartData.Tables["PartRev"].Rows[LastRowIndex]["RevisionNum"].ToString();

                EpicClose();

                return PartRev;
            }
            catch { return ""; }
        }
开发者ID:Balkanheart,项目名称:EpicorIntegration,代码行数:20,代码来源:DataList.cs

示例6: PartUOM

        public static DataTable PartUOM(string PartNumber)
        {
            try
            {
                Part Part = new Part(EpicConn);

                PartDataSet PartData = new PartDataSet();

                PartData = Part.GetByID(PartNumber);

                EpicClose();

                return PartData.Tables["PartUOM"];
            }
            catch { return null; }
        }
开发者ID:Balkanheart,项目名称:EpicorIntegration,代码行数:16,代码来源:DataList.cs

示例7: GetCurrentDesc

        public static string GetCurrentDesc(string PartNumber)
        {
            try
            {
                Part Part = new Part(EpicConn);

                PartDataSet PartData = new PartDataSet();

                PartData = Part.GetByID(PartNumber);

                int LastRowIndex = PartData.Tables["Part"].Rows.Count - 1;

                string PartDesc = PartData.Tables["Part"].Rows[LastRowIndex]["PartDescription"].ToString();

                EpicClose();

                return PartDesc;
            }
            catch { return null; }
        }
开发者ID:Balkanheart,项目名称:EpicorIntegration,代码行数:20,代码来源:DataList.cs

示例8: CreatePartRevision

        public static bool CreatePartRevision(string PartNumber, string CurrentRev, string NewRev, string RevDesc)
        {
            bool _results;

            try
            {
                Part Part = new Part(DataList.EpicConn);

                PartDataSet PartData = new PartDataSet();

                PartData = Part.GetByID(PartNumber);

                Part.GetNewPartRev(PartData, PartNumber, CurrentRev);

                int Y = PartData.Tables["PartRev"].Rows.Count - 1;

                DataList.UpdateDatum(PartData, "PartRev", Y, "RevShortDesc", RevDesc);

                DataList.UpdateDatum(PartData, "PartRev", Y, "RevisionNum", NewRev);

                DataList.UpdateDatum(PartData, "PartRev", Y, "AltMethod", "");

                Part.Update(PartData);

                _results = true;
            }
            catch { _results = false; }
            finally
            {
                EpicClose();
            }

            return _results;
        }
开发者ID:Balkanheart,项目名称:EpicorIntegration,代码行数:34,代码来源:DataList.cs

示例9: PartExists

        public static bool PartExists(string partnumber)
        {
            Part Part = new Part(EpicConn);

            PartDataSet Pdata = new PartDataSet();

            try
            {
                Pdata = Part.GetByID(partnumber);
            }
            catch
            {
                EpicClose();

                return false;
            }

            EpicClose();

            return true;
        }
开发者ID:virall,项目名称:EpicorIntegration,代码行数:21,代码来源:DataList.cs

示例10: savebtn_Click

        private void savebtn_Click(object sender, EventArgs e)
        {
            try
            {
                //Commit Part Changes

                Part Part = new Part(DataList.EpicConn);

                PartDataSet Pdata = new PartDataSet();

                //Pdata = (PartDataSet)DL.PartSearchDataSet("");

                string serialWarning;

                string questionString;

                bool multipleMatch;

                string PartNumber = Partnumber_txt.Text;

                Part.GetPartXRefInfo(ref PartNumber, "", "", out serialWarning, out questionString, out multipleMatch);

                if (!multipleMatch)
                {
                    Part.GetNewPart(Pdata);

                    Part.ChangePartNum(PartNumber, Pdata);

                    DataList.AddDatum(Pdata, "Part",  0, "PartDescription", Description_txt.Text);

                    //SearchWord has 8 character limit
                    if (Description_txt.Text.Length > 8)
                        DataList.AddDatum(Pdata, "Part", 0, "SearchWord", Description_txt.Text.Substring(0, 8));
                    else
                        DataList.AddDatum(Pdata, "Part", 0, "SearchWord", Description_txt.Text);

                    DataList.AddDatum(Pdata, "Part", 0, "NetWeight", NetWeight.Text);

                    DataList.AddDatum(Pdata, "Part", 0, "NetWeightUOM", uomweight_cbo.SelectedValue.ToString());

                    //DataList.AddDatum(Pdata, "Part", 0, "NetVolume", NetVolume.Text);

                    //DataList.AddDatum(Pdata, "Part", 0, "NetVolumeUOM", uomvol_cbo.SelectedValue.ToString());

                    DataList.AddDatum(Pdata, "Part", 0, "IUM", uom_cbo.SelectedValue.ToString());

                    DataList.AddDatum(Pdata, "Part", 0, "ClassID", class_cbo.SelectedValue.ToString());

                    string Type_Code = type_cbo.SelectedItem.ToString();

                    Part.ChangePartTypeCode(Type_Code, Pdata);

                    Part.ChangePartProdCode(group_cbo.SelectedValue.ToString(), Pdata);

                    //Add data to allow BO to create plant tables
                    Part.Update(Pdata);

                    //retrieve the new copy of the data
                    Pdata = Part.GetByID(PartNumber);

                    DataList.UpdateDatum(Pdata, "PartPlant", 0, "PrimWhse", whse_cbo.SelectedValue.ToString());

                    DataList.UpdateDatum(Pdata, "PartPlant", 0, "PrimWhseDescription", whse_cbo.Text);

                    DataList.UpdateDatum(Pdata, "PartPlant", 0, "DBRowIdent", null);

                    //Update with warehouse information
                    Part.Update(Pdata);

                    DataList.EpicClose();
                }
                else
                {
                    MessageBox.Show("Part already exists in database!  Use revision to make changes.");
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            finally
            {
                this.Close();
            }
        }
开发者ID:Balkanheart,项目名称:EpicorIntegration,代码行数:85,代码来源:Item_Master.cs

示例11: AlreadyCheckedOut

        void AlreadyCheckedOut()
        {
            if (rev_txt.Text != "" && rev_txt.Text != null && pnum_txt.Text != "" && pnum_txt.Text != null)
            {
                //Get Part info, if checked out by GID set flag and enable buttons
                try
                {
                    Part Part = new Part(DataList.EpicConn);

                    PartDataSet Pdata = Part.GetByID(pnum_txt.Text);

                    int lastrow = 0;

                    bool valid = false;

                    for (int i = 0; i < Pdata.Tables["PartRev"].Rows.Count; i++)
                    {
                        if (Pdata.Tables["PartRev"].Rows[i]["RevisionNum"].ToString() == rev_txt.Text)
                        {
                            lastrow = i;

                            valid =  true;
                        }
                    }

                    if (valid)
                    {
                        if (Pdata.Tables["PartRev"].Rows[lastrow]["ECOGroup"].ToString() != "" && Pdata.Tables["PartRev"].Rows[lastrow]["ECOGroup"].ToString() != null)
                        {
                            desc_txt.Text = Pdata.Tables["PartRev"].Rows[lastrow]["RevShortDesc"].ToString();

                            revcomments_txt.Text = Pdata.Tables["PartRev"].Rows[lastrow]["RevDescription"].ToString();

                            eco_txt.Text = Pdata.Tables["PartRev"].Rows[lastrow]["ECO"].ToString();

                            checkedout_chk.Checked = true;

                            addrev_btn.Enabled = false;

                            useswrev_chk.Enabled = false;

                            item_btn.Enabled = true;

                            getdetails_btn.Enabled = true;

                            ops_btn.Enabled = true;

                            bill_btn.Enabled = true;

                            approved_btn.Enabled = true;

                            rev_txt.ReadOnly = true;

                            pnum_txt.ReadOnly = true;
                        }
                    }
                }
                catch { }
            }
        }
开发者ID:virall,项目名称:EpicorIntegration,代码行数:60,代码来源:Main.cs


注:本文中的Part.GetByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。