zrg
2024-03-07 355dec078e44db52fc6c6371debbe44898e6f1f1
BLL/ϵͳ¹«ÓÃCLS/ClsBaseSelect_InterFace.cs
@@ -583,6 +583,32 @@
            }
        }
        //选择接口类物料  æ ¹æ®ç»„织过滤
        /// <summary>
        /// é€‰æ‹©æŽ¥å£ç±»ç‰©æ–™  æ ¹æ®ç»„织过滤
        /// </summary>
        /// <param name="txt"></param>
        public static void SetTextByMater(string sWhere, TextBox txt, TextBox txt2, TextBox txt3)
        {
            DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View();
            if (oMater.RefreshViewForBig(sWhere))
            {
                if (oMater.GetInfoByID(oMater.oModel.HItemID))
                {
                    txt.Text = oMater.omodel.HNumber;
                    txt.Tag = oMater.omodel.HItemID.ToString();
                    txt2.Text = oMater.omodel.HName;
                    txt3.Text = oMater.omodel.HModel;
                }
            }
            else
            {
                txt.Text = "";
                txt2.Text = "";
                txt3.Text = "";
            }
        }
        //选择接口类物料
        /// <summary>
        /// é€‰æ‹©æŽ¥å£ç±»ç‰©æ–™
@@ -682,6 +708,54 @@
                grdMain.Rows[i].Cells[HUnitNameCol].Value = "";
            }
        }
        //接口类物料-网格  æ ¹æ®ç»„织过滤
        /// <summary>
        /// æŽ¥å£ç±»ç‰©æ–™-网格  æ ¹æ®ç»„织过滤
        /// </summary>
        /// <param name="grdMain"></param>
        /// <param name="i"></param>
        /// <param name="HMaterIDCol"></param>
        /// <param name="HMaterNumberCol"></param>
        /// <param name="HMaterNameCol"></param>
        public static void SetGridByMater(DataGridView grdMain, string sWhere, int i, int HMaterIDCol, int HMaterNumberCol, int HMaterNameCol, int HMaterModelCol, int HUnitIDCol, int HUnitNumberCol, int HUnitNameCol)
        {
            DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View();
            if (oMater.RefreshViewForBig(sWhere))
            {
                if (oMater.GetInfoByID(oMater.oModel.HItemID))
                {
                    grdMain.Rows[i].Cells[HMaterIDCol].Value = oMater.omodel.HItemID.ToString();
                    grdMain.Rows[i].Cells[HMaterNumberCol].Value = oMater.omodel.HNumber;
                    grdMain.Rows[i].Cells[HMaterNameCol].Value = oMater.omodel.HName;
                    grdMain.Rows[i].Cells[HMaterModelCol].Value = oMater.omodel.HModel;
                    grdMain.Rows[i].Cells[HUnitIDCol].Value = oMater.omodel.HUnitID;
                    grdMain.Rows[i].Cells[HUnitNumberCol].Value = oMater.omodel.HUnitNumber;
                    grdMain.Rows[i].Cells[HUnitNameCol].Value = oMater.omodel.HUnitName;
                }
                else
                {
                    grdMain.Rows[i].Cells[HMaterIDCol].Value = "0";
                    grdMain.Rows[i].Cells[HMaterNumberCol].Value = "";
                    grdMain.Rows[i].Cells[HMaterNameCol].Value = "";
                    grdMain.Rows[i].Cells[HMaterModelCol].Value = "";
                    grdMain.Rows[i].Cells[HUnitIDCol].Value = "0";
                    grdMain.Rows[i].Cells[HUnitNumberCol].Value = "";
                    grdMain.Rows[i].Cells[HUnitNameCol].Value = "";
                }
            }
            else
            {
                grdMain.Rows[i].Cells[HMaterIDCol].Value = "0";
                grdMain.Rows[i].Cells[HMaterNumberCol].Value = "";
                grdMain.Rows[i].Cells[HMaterNameCol].Value = "";
                grdMain.Rows[i].Cells[HMaterModelCol].Value = "";
                grdMain.Rows[i].Cells[HUnitIDCol].Value = "0";
                grdMain.Rows[i].Cells[HUnitNumberCol].Value = "";
                grdMain.Rows[i].Cells[HUnitNameCol].Value = "";
            }
        }
        //接口类物料-网格
        /// <summary>
        /// æŽ¥å£ç±»ç‰©æ–™-网格
@@ -1054,5 +1128,41 @@
            }
        }
        //接口类工作中心-网格
        /// <summary>
        /// æŽ¥å£ç±»å·¥ä½œä¸­å¿ƒ-网格
        /// </summary>
        /// <param name="grdMain"></param>
        /// <param name="i"></param>
        /// <param name="HWorkCenterIDCol"></param>
        /// <param name="HWorkCenterNumberCol"></param>
        /// <param name="HWorkCenterNameCol"></param>
        public static void SetGridByWorkCenter(DataGridView grdMain, int i, int HWorkCenterIDCol, int HWorkCenterNumberCol, int HWorkCenterNameCol)
        {
            DAL.ClsIF_WorkCenter_View oWorkCenter = new DAL.ClsIF_WorkCenter_View();
            if (oWorkCenter.RefreshView())
            {
                if (oWorkCenter.GetInfoByID(oWorkCenter.oModel.HItemID))
                {
                    grdMain.Rows[i].Cells[HWorkCenterIDCol].Value = oWorkCenter.omodel.HItemID.ToString();
                    grdMain.Rows[i].Cells[HWorkCenterNumberCol].Value = oWorkCenter.omodel.HNumber;
                    grdMain.Rows[i].Cells[HWorkCenterNameCol].Value = oWorkCenter.omodel.HName;
                }
                else
                {
                    grdMain.Rows[i].Cells[HWorkCenterIDCol].Value = "0";
                    grdMain.Rows[i].Cells[HWorkCenterNumberCol].Value = "";
                    grdMain.Rows[i].Cells[HWorkCenterNameCol].Value = "";
                }
            }
            else
            {
                grdMain.Rows[i].Cells[HWorkCenterIDCol].Value = "0";
                grdMain.Rows[i].Cells[HWorkCenterNumberCol].Value = "";
                grdMain.Rows[i].Cells[HWorkCenterNameCol].Value = "";
            }
        }
    }
}