public DataTable GetResTemplates()
        {
            ENGDataDataSet.TemplatesDataTable RetVal = new ENGDataDataSet.TemplatesDataTable();

            TemplateAdapter.FillByType(RetVal, "RES");

            return (DataTable)RetVal;
        }
        public PartData ParseItemTemplate(string TemplateName)
        {
            PartData Pdata = new PartData();

            //ENGDataDataSetTableAdapters.TemplatesTableAdapter TableAdapter = new ENGDataDataSetTableAdapters.TemplatesTableAdapter();

            ENGDataDataSet.TemplatesDataTable DT = new ENGDataDataSet.TemplatesDataTable();

            TemplateAdapter.FillByNameType(DT, "ITEM", TemplateName);

            foreach (DataRow Dr in DT.Rows)
            {
                if (Dr["PropertyType"].ToString() == "TYPE")
                    Pdata.PMT = Dr["PropertyValue"].ToString();

                if (Dr["PropertyType"].ToString() == "UOM")
                    Pdata.Primary_UOM = Dr["PropertyValue"].ToString();

                if (Dr["PropertyType"].ToString() == "GROUP")
                    Pdata.PartGroup = Dr["PropertyValue"].ToString();

                if (Dr["PropertyType"].ToString() == "QTYBEARING")
                    try
                    {
                        Pdata.QtyBearing = bool.Parse(Dr["PropertyValue"].ToString());
                    }
                    catch { pdata.QtyBearing = false; }

                if (Dr["PropertyType"].ToString() == "CLASS")
                    Pdata.PartClass = Dr["PropertyValue"].ToString();

                if (Dr["PropertyType"].ToString() == "USEREV")
                    try
                    {
                        Pdata.UseRevision = bool.Parse(Dr["PropertyValue"].ToString());
                    }
                    catch { pdata.UseRevision = false; }

                if (Dr["PropertyType"].ToString() == "TRACKSERIAL")
                {
                    try
                    {
                        Pdata.TrackSerial = bool.Parse(Dr["PropertyValue"].ToString());
                    }
                    catch { pdata.TrackSerial = false; }

                    Pdata.TrackSerial_Mask = Dr["PropertyOptions"].ToString();
                }

                if (Dr["PropertyType"].ToString() == "PLANT")
                    Pdata.PartPlant = Dr["PropertyValue"].ToString();

                if (Dr["PropertyType"].ToString() == "WAREHOUSE")
                {
                    Pdata.PlantWhse.Add(Dr["PropertyValue"].ToString());

                    Pdata.PlantWhse_Code.Add(Dr["PropertyQty"].ToString());
                }

                if (Dr["PropertyType"].ToString() == "PLANNER")
                    Pdata.Planner = Dr["PropertyValue"].ToString();

                if (Dr["PropertyType"].ToString() == "WEIGHT_UOM")
                    Pdata.Net_Weight_UM = Dr["PropertyValue"].ToString();
            }

            return Pdata;
        }
        public DataTable GetFullTemplate(string Name, string Type)
        {
            ENGDataDataSet.TemplatesDataTable RetVal = new ENGDataDataSet.TemplatesDataTable();

            TemplateAdapter.FillByNameType(RetVal, Type, Name);

            return (DataTable)RetVal;
        }