using System; 
 | 
using System.Collections.Generic; 
 | 
using System.Text; 
 | 
using System.Windows.Forms; 
 | 
  
 | 
namespace BLL 
 | 
{ 
 | 
    /// <summary> 
 | 
    /// ·µ»Ø»ù´¡×ÊÁÏÐÅÏ¢ÀàCLD 
 | 
    /// </summary> 
 | 
    public class ClsBaseSelect_CLD 
 | 
    { 
 | 
  
 | 
        #region ÉèÖÃÎı¾¿ò 
 | 
  
 | 
        //Ñ¡ÔñCLDÖ°Ô± 
 | 
        public static void SetTextByEmp_CLD(TextBox txt) 
 | 
        { 
 | 
            //DAL.ClsCLD_Employee_View oEmp = new DAL.ClsCLD_Employee_View(); 
 | 
            //if (oEmp.RefreshView()) 
 | 
            //{ 
 | 
            //    txt.Text = oEmp.oModel.HName; 
 | 
            //    txt.Tag = oEmp.oModel.HItemID.ToString(); 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    txt.Text = ""; 
 | 
            //} 
 | 
        } 
 | 
  
 | 
          
 | 
  
 | 
        //Ñ¡ÔñCLD²¿ÃÅ 
 | 
        /// <summary> 
 | 
        /// Ñ¡ÔñCLD²¿ÃÅ 
 | 
        /// </summary> 
 | 
        /// <param name="txt">µÝÈëÎı¾¿ò</param> 
 | 
        /// <param name="BackNumber">ÊÇ·ñ·µ»Ø´úÂë</param> 
 | 
        public static void SetTextByDept_CLD(TextBox txt,bool BackNumber) 
 | 
        { 
 | 
            DAL.ClsCLD_Department_View oDept = new DAL.ClsCLD_Department_View(); 
 | 
            if (oDept.RefreshView()) 
 | 
            { 
 | 
                if (BackNumber==false) 
 | 
                { 
 | 
                    txt.Text = oDept.oModel.HName; 
 | 
                    txt.Tag = oDept.oModel.HItemID.ToString(); 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    txt.Text = oDept.oModel.HNumber; 
 | 
                    txt.Tag = oDept.oModel.HItemID.ToString(); 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                txt.Text = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
  
 | 
  
 | 
  
 | 
        //Ñ¡ÔñCLD²Ö¿â 
 | 
        public static void SetTextByWareHouse_CLD(TextBox txt) 
 | 
        { 
 | 
            DAL.ClsCLD_Warehouse_View oWh = new DAL.ClsCLD_Warehouse_View(); 
 | 
            if (oWh.RefreshView()) 
 | 
            { 
 | 
                txt.Text = oWh.oModel.HName; 
 | 
                txt.Tag = oWh.oModel.HItemID.ToString(); 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                txt.Text = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        //Ñ¡ÔñCLD²Ö¿â 
 | 
        public static void SetTextByWareHouse_CLD(TextBox txt,bool BackNumber) 
 | 
        { 
 | 
            DAL.ClsCLD_Warehouse_View oWh = new DAL.ClsCLD_Warehouse_View(); 
 | 
            if (oWh.RefreshView()) 
 | 
            { 
 | 
                txt.Text = oWh.oModel.HNumber;  
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                txt.Text = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        //Ñ¡ÔñCLD¿Í»§ 
 | 
        public static void SetTextByCus_CLD(TextBox txt) 
 | 
        { 
 | 
            DAL.ClsCLD_Customer_View oCus = new DAL.ClsCLD_Customer_View(); 
 | 
            if (oCus.RefreshView()) 
 | 
            { 
 | 
                txt.Text = oCus.oModel.HName; 
 | 
                txt.Tag = oCus.oModel.HItemID.ToString(); 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                txt.Text = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        
 | 
  
 | 
         
 | 
  
 | 
        //Ñ¡ÔñCLD¹©Ó¦ÉÌ 
 | 
        public static void SetTextBySupplier_CLD(TextBox txt) 
 | 
        { 
 | 
            DAL.ClsCLD_Supplier_View oSup = new DAL.ClsCLD_Supplier_View(); 
 | 
            if (oSup.RefreshView()) 
 | 
            { 
 | 
                txt.Text = oSup.oModel.HName; 
 | 
                txt.Tag = oSup.oModel.HItemID.ToString(); 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                txt.Text = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        //Ñ¡ÔñCLD¼ÆÁ¿µ¥Î» 
 | 
        public static void SetTextByUnit_CLD(TextBox txt) 
 | 
        { 
 | 
            DAL.ClsCLD_Unit_View oUnit = new DAL.ClsCLD_Unit_View(); 
 | 
            if (oUnit.RefreshView()) 
 | 
            { 
 | 
                txt.Text = oUnit.oModel.HName; 
 | 
                txt.Tag = oUnit.oModel.HItemID.ToString(); 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                txt.Text = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
         
 | 
  
 | 
        //Ñ¡ÔñCLDÎïÁÏÉϼ¶×é 
 | 
        public static void SetTextByMaterGroup_CLD(TextBox txt) 
 | 
        { 
 | 
            //DAL.ClsCLD_MaterGroup_View oMaterGroup = new DAL.ClsCLD_MaterGroup_View(); 
 | 
            //if (oMaterGroup.RefreshViewForBig()) 
 | 
            //{ 
 | 
            //    txt.Text = oMaterGroup.oModel.HNumber; 
 | 
            //    txt.Tag = oMaterGroup.oModel.HItemID.ToString(); 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    txt.Text = ""; 
 | 
            //} 
 | 
        } 
 | 
  
 | 
        //Ñ¡ÔñCLDÎïÁÏ 
 | 
        /// <summary> 
 | 
        /// Ñ¡ÔñCLDÎïÁÏ 
 | 
        /// </summary> 
 | 
        /// <param name="txtNumber">´úÂëÎı¾¿ò</param> 
 | 
        /// <param name="txtName">Ãû³ÆÎı¾¿ò</param> 
 | 
        /// <param name="txtModel">¹æ¸ñÎı¾¿ò</param> 
 | 
        /// <param name="txtUnit">µ¥Î»Îı¾¿ò</param> 
 | 
        public static void SetTextByMater_CLD(TextBox txtNumber,TextBox txtName,TextBox txtModel,TextBox txtUnit) 
 | 
        { 
 | 
            DAL.ClsCLD_Material_View oMater = new DAL.ClsCLD_Material_View(); 
 | 
            DAL.ClsCLD_Unit_View oUnit = new DAL.ClsCLD_Unit_View(); 
 | 
            if (oMater.RefreshView()) 
 | 
            { 
 | 
                if (oMater.GetInfoByID(oMater.omodel.HItemID)) 
 | 
                { 
 | 
                    txtNumber.Tag = oMater.omodel.HItemID.ToString(); 
 | 
                    txtNumber.Text = oMater.omodel.HNumber; 
 | 
                    txtName.Text = oMater.omodel.HName; 
 | 
                    txtModel.Text = oMater.omodel.HModel; 
 | 
                    if (oUnit.GetInfoByID(oMater.omodel.HItemID)) 
 | 
                    { 
 | 
                        txtUnit.Text = oUnit.omodel.HName; 
 | 
                        txtUnit.Tag = oUnit.omodel.HItemID.ToString(); 
 | 
                    } 
 | 
                    else 
 | 
                    { 
 | 
                        txtUnit.Text =""; 
 | 
                        txtUnit.Tag = "0"; 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                txtNumber.Tag = "0"; 
 | 
                txtNumber.Text = ""; 
 | 
                txtName.Text = ""; 
 | 
                txtModel.Text = ""; 
 | 
                txtUnit.Text = ""; 
 | 
                txtUnit.Tag = "0"; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        //Ñ¡ÔñCLDÎïÁÏ 
 | 
        /// <summary> 
 | 
        /// Ñ¡ÔñCLDÎïÁÏ 
 | 
        /// </summary> 
 | 
        /// <param name="txtNumber">´úÂëÎı¾¿ò</param> 
 | 
        public static void SetTextByMater_CLD(TextBox txtNumber) 
 | 
        { 
 | 
            DAL.ClsCLD_Material_View oMater = new DAL.ClsCLD_Material_View();  
 | 
            if (oMater.RefreshView()) 
 | 
            { 
 | 
                if (oMater.GetInfoByID(oMater.omodel.HItemID)) 
 | 
                { 
 | 
                    txtNumber.Tag = oMater.omodel.HItemID.ToString(); 
 | 
                    txtNumber.Text = oMater.omodel.HNumber; 
 | 
                      
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    txtNumber.Tag = "0"; 
 | 
                    txtNumber.Text = ""; 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                txtNumber.Tag = "0"; 
 | 
                txtNumber.Text = "";  
 | 
            } 
 | 
        } 
 | 
  
 | 
        //Ñ¡ÔñCLD±Ò±ð 
 | 
        public static void SetTextByCur_CLD(TextBox txt,TextBox txtHRate) 
 | 
        { 
 | 
            //DAL.ClsCLD_Currency_View oCur = new DAL.ClsCLD_Currency_View(); 
 | 
            //if (oCur.RefreshView()) 
 | 
            //{ 
 | 
            //    if (oCur.GetInfoByID(oCur.oModel.HItemID)) 
 | 
            //    { 
 | 
            //        txt.Text = oCur.omodel.HName; 
 | 
            //        txt.Tag = oCur.omodel.HItemID.ToString(); 
 | 
            //        txtHRate.Text = oCur.omodel.HExRate.ToString(); 
 | 
            //    } 
 | 
            //    else 
 | 
            //    { 
 | 
            //        txt.Text = ""; 
 | 
            //        txt.Tag = "0"; 
 | 
            //        txtHRate.Text = "1"; 
 | 
            //    } 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    txt.Text = ""; 
 | 
            //    txt.Tag = "0"; 
 | 
            //    txtHRate.Text = "1"; 
 | 
            //} 
 | 
        } 
 | 
        //Ñ¡ÔñCLDÁìÁϵ¥ 
 | 
        public static void SetTextByMateOutBill_CLD(TextBox txt) 
 | 
        { 
 | 
            //DAL.ClsCLD_MateOutBill_View oMateOutBill = new DAL.ClsCLD_MateOutBill_View(); 
 | 
            //if (oMateOutBill.RefreshView()) 
 | 
            //{ 
 | 
            //    txt.Text = oMateOutBill.oModel.HNumber.ToString(); 
 | 
            //    txt.Tag = oMateOutBill.oModel.HItemID.ToString(); 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    txt.Text = ""; 
 | 
            //} 
 | 
        } 
 | 
        //Ñ¡ÔñÁìÁÏÉêÇëµ¥ 
 | 
        public static void SetTextByMateOutRequestBill_CLD(TextBox txt) 
 | 
        { 
 | 
            //DAL.ClsKf_MateOutRequestBill_View oMateOutRequestBill = new DAL.ClsKf_MateOutRequestBill_View(); 
 | 
            //if (oMateOutRequestBill.RefreshView()) 
 | 
            //{ 
 | 
            //    txt.Text = oMateOutRequestBill.oModel.HNumber.ToString(); 
 | 
            //    txt.Tag = oMateOutRequestBill.oModel.HItemID.ToString(); 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    txt.Text = ""; 
 | 
            //} 
 | 
        } 
 | 
  
 | 
  
 | 
        //Ñ¡ÔñÉú²úÈÎÎñµ¥CLD 
 | 
        public static void SetTextByICMOBill_CLD(TextBox txt) 
 | 
        { 
 | 
            //DAL.ClsCLD_ICMOBill_View oICMO = new DAL.ClsCLD_ICMOBill_View(); 
 | 
            //if (oICMO.RefreshView()) 
 | 
            //{ 
 | 
            //    txt.Text = oICMO.oModel.HNumber.ToString(); 
 | 
            //    txt.Tag = oICMO.oModel.HItemID.ToString(); 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    txt.Text = ""; 
 | 
            //} 
 | 
        }  
 | 
  
 | 
        #endregion 
 | 
  
 | 
  
 | 
        #region  ÉèÖÃÍø¸ñ 
 | 
  
 | 
        //ÎïÁÏ-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ÎïÁÏ-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HMaterIDCol"></param> 
 | 
        /// <param name="HMaterNumberCol"></param> 
 | 
        /// <param name="HMaterNameCol"></param> 
 | 
        /// <param name="HMaterModelCol"></param> 
 | 
        /// <param name="HUnitIDCol"></param> 
 | 
        /// <param name="HUnitNumberCol"></param> 
 | 
        /// <param name="HUnitNameCol"></param> 
 | 
        public static void SetGridByMater_CLD(DataGridView grdMain, int i, int HMaterIDCol, int HMaterNumberCol, int HMaterNameCol, int HMaterModelCol, int HUnitIDCol, int HUnitNumberCol, int HUnitNameCol) 
 | 
        { 
 | 
            DAL.ClsCLD_Material_View oMater = new DAL.ClsCLD_Material_View(); 
 | 
            DAL.ClsCLD_Unit_View oUnit = new DAL.ClsCLD_Unit_View(); 
 | 
            if (oMater.RefreshView()) 
 | 
            { 
 | 
                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; 
 | 
                    if (oUnit.GetInfoByID(oMater.omodel.HUnitID)) 
 | 
                    { 
 | 
                        grdMain.Rows[i].Cells[HUnitNumberCol].Value = oUnit.omodel.HNumber; 
 | 
                        grdMain.Rows[i].Cells[HUnitNameCol].Value = oUnit.omodel.HName; 
 | 
                        grdMain.Rows[i].Cells[HUnitIDCol].Value = oUnit.omodel.HItemID.ToString(); 
 | 
                    } 
 | 
                    else 
 | 
                    { 
 | 
                        grdMain.Rows[i].Cells[HUnitNumberCol].Value = ""; 
 | 
                        grdMain.Rows[i].Cells[HUnitNameCol].Value = ""; 
 | 
                        grdMain.Rows[i].Cells[HUnitIDCol].Value = "0"; 
 | 
                    } 
 | 
                } 
 | 
                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[HUnitNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HUnitNameCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HUnitIDCol].Value = "0"; 
 | 
                } 
 | 
            } 
 | 
            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[HUnitNumberCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HUnitNameCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HUnitIDCol].Value = "0"; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        //²Ö¿â-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ²Ö¿â-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HWhIDCol"></param> 
 | 
        /// <param name="HWhNumberCol"></param> 
 | 
        /// <param name="HWhNameCol"></param> 
 | 
        public static void SetGridByWareHouse_CLD(DataGridView grdMain, int i, int HWhIDCol, int HWhNumberCol, int HWhNameCol) 
 | 
        { 
 | 
            DAL.ClsCLD_Warehouse_View oWh = new DAL.ClsCLD_Warehouse_View(); 
 | 
            if (oWh.RefreshView()) 
 | 
            { 
 | 
                if (oWh.GetInfoByID(oWh.oModel.HItemID)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HWhIDCol].Value = oWh.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HWhNumberCol].Value = oWh.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HWhNameCol].Value = oWh.omodel.HName; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HWhIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HWhNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HWhNameCol].Value = ""; 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                grdMain.Rows[i].Cells[HWhIDCol].Value = "0"; 
 | 
                grdMain.Rows[i].Cells[HWhNumberCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HWhNameCol].Value = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
  
 | 
        //ÎïÁÏ-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ÎïÁÏ-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HMaterIDCol"></param> 
 | 
        /// <param name="HMaterNumberCol"></param> 
 | 
        /// <param name="HMaterNameCol"></param> 
 | 
        /// <param name="HMaterModelCol"></param> 
 | 
        /// <param name="HUnitIDCol"></param> 
 | 
        /// <param name="HUnitNumberCol"></param> 
 | 
        /// <param name="HUnitNameCol"></param> 
 | 
        public static void SetGridByMater_CLD(DataGridView grdMain, int i, int HMaterIDCol, int HMaterNumberCol, int HMaterNameCol, int HMaterModelCol, int HUnitIDCol, int HUnitNumberCol, int HUnitNameCol, int HQtyDecimalCol, int HPriceDecimalCol) 
 | 
        { 
 | 
            DAL.ClsCLD_Material_View oMater = new DAL.ClsCLD_Material_View(); 
 | 
            DAL.ClsCLD_Unit_View oUnit = new DAL.ClsCLD_Unit_View(); 
 | 
            if (oMater.RefreshView()) 
 | 
            { 
 | 
                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[HQtyDecimalCol].Value = oMater.omodel.HQtyDecimal; 
 | 
                    //grdMain.Rows[i].Cells[HPriceDecimalCol].Value = oMater.omodel.HPriceDecimal; 
 | 
                    if (oUnit.GetInfoByID(oMater.omodel.HUnitID)) 
 | 
                    { 
 | 
                        grdMain.Rows[i].Cells[HUnitNumberCol].Value = oUnit.omodel.HNumber; 
 | 
                        grdMain.Rows[i].Cells[HUnitNameCol].Value = oUnit.omodel.HName; 
 | 
                        grdMain.Rows[i].Cells[HUnitIDCol].Value = oUnit.omodel.HItemID.ToString(); 
 | 
                    } 
 | 
                    else 
 | 
                    { 
 | 
                        grdMain.Rows[i].Cells[HUnitNumberCol].Value = ""; 
 | 
                        grdMain.Rows[i].Cells[HUnitNameCol].Value = ""; 
 | 
                        grdMain.Rows[i].Cells[HUnitIDCol].Value = "0"; 
 | 
                    } 
 | 
                } 
 | 
                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[HQtyDecimalCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HPriceDecimalCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HUnitNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HUnitNameCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HUnitIDCol].Value = "0"; 
 | 
                } 
 | 
            } 
 | 
            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[HQtyDecimalCol].Value = "0"; 
 | 
                grdMain.Rows[i].Cells[HPriceDecimalCol].Value = "0"; 
 | 
                grdMain.Rows[i].Cells[HUnitNumberCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HUnitNameCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HUnitIDCol].Value = "0"; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        //²Öλ-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ²Öλ-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HSPIDCol"></param> 
 | 
        /// <param name="HSPNumberCol"></param> 
 | 
        /// <param name="HSPNameCol"></param> 
 | 
        public static void SetGridByStockPlace_CLD(DataGridView grdMain, int i, int HSPIDCol, int HSPNumberCol, int HSPNameCol) 
 | 
        { 
 | 
            DAL.ClsCLD_StockPlace_View oSP = new DAL.ClsCLD_StockPlace_View(); 
 | 
            if (oSP.RefreshView()) 
 | 
            { 
 | 
                if (oSP.GetInfoByID(oSP.oModel.HItemID)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HSPIDCol].Value = oSP.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HSPNumberCol].Value = oSP.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HSPNameCol].Value = oSP.omodel.HName; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HSPIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HSPNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HSPNameCol].Value = ""; 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                grdMain.Rows[i].Cells[HSPIDCol].Value = "0"; 
 | 
                grdMain.Rows[i].Cells[HSPNumberCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HSPNameCol].Value = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
        //²Öλ-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ²Öλ-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HSPIDCol"></param> 
 | 
        /// <param name="HSPNumberCol"></param> 
 | 
        /// <param name="HSPNameCol"></param> 
 | 
        public static void SetGridByStockPlace_CLD(DataGridView grdMain, int i,Int64 HMaterID, int HSPIDCol, int HSPNumberCol, int HSPNameCol) 
 | 
        { 
 | 
            DAL.ClsCLD_StockPlace_View oSP = new DAL.ClsCLD_StockPlace_View(); 
 | 
            if (oSP.RefreshViewByRelation(HMaterID)) 
 | 
            { 
 | 
                if (oSP.GetInfoByID(oSP.oModel.HItemID)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HSPIDCol].Value = oSP.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HSPNumberCol].Value = oSP.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HSPNameCol].Value = oSP.omodel.HName; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HSPIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HSPNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HSPNameCol].Value = ""; 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                grdMain.Rows[i].Cells[HSPIDCol].Value = "0"; 
 | 
                grdMain.Rows[i].Cells[HSPNumberCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HSPNameCol].Value = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
  
 | 
        //¼ÆÁ¿µ¥Î»-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ¼ÆÁ¿µ¥Î»-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HUnitIDCol"></param> 
 | 
        /// <param name="HUnitNumberCol"></param> 
 | 
        /// <param name="HUnitNameCol"></param> 
 | 
        public static void SetGridByUnit_CLD(DataGridView grdMain, int i, int HUnitIDCol, int HUnitNumberCol, int HUnitNameCol) 
 | 
        { 
 | 
  
 | 
            DAL.ClsCLD_Unit_View oUnit = new DAL.ClsCLD_Unit_View(); 
 | 
            if (oUnit.RefreshView()) 
 | 
            { 
 | 
                if (oUnit.GetInfoByID(oUnit.oModel.HItemID)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HUnitIDCol].Value = oUnit.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HUnitNumberCol].Value = oUnit.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HUnitNameCol].Value = oUnit.omodel.HName; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HUnitIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HUnitNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HUnitNameCol].Value = ""; 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                grdMain.Rows[i].Cells[HUnitIDCol].Value = "0"; 
 | 
                grdMain.Rows[i].Cells[HUnitNumberCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HUnitNameCol].Value = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
  
 | 
         
 | 
  
 | 
        //ÎïÁÏÉϼ¶×é-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ÎïÁÏÉϼ¶×é-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HParentIDCol"></param> 
 | 
        /// <param name="HParentNumberCol"></param> 
 | 
        public static void SetGridByMaterGroup_CLD(DataGridView grdMain, int i, int HParentIDCol, int HParentNumberCol,int HParentNameCol) 
 | 
        { 
 | 
  
 | 
            //DAL.ClsCLD_MaterGroup_View oMaterGroup = new DAL.ClsCLD_MaterGroup_View(); 
 | 
            //if (oMaterGroup.RefreshViewForBig()) 
 | 
            //{ 
 | 
            //    if (oMaterGroup.GetInfoByID(oMaterGroup.oModel.HItemID)) 
 | 
            //    { 
 | 
            //        grdMain.Rows[i].Cells[HParentIDCol].Value = oMaterGroup.omodel.HItemID.ToString(); 
 | 
            //        grdMain.Rows[i].Cells[HParentNumberCol].Value = oMaterGroup.omodel.HNumber; 
 | 
            //        grdMain.Rows[i].Cells[HParentNameCol].Value = oMaterGroup.omodel.HName;  
 | 
            //    } 
 | 
            //    else 
 | 
            //    { 
 | 
            //        grdMain.Rows[i].Cells[HParentIDCol].Value = "0"; 
 | 
            //        grdMain.Rows[i].Cells[HParentNumberCol].Value = ""; 
 | 
            //        grdMain.Rows[i].Cells[HParentNameCol].Value = "";  
 | 
            //    } 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    grdMain.Rows[i].Cells[HParentIDCol].Value = "0"; 
 | 
            //    grdMain.Rows[i].Cells[HParentNumberCol].Value = ""; 
 | 
            //    grdMain.Rows[i].Cells[HParentNameCol].Value = "";  
 | 
            //} 
 | 
        } 
 | 
  
 | 
  
 | 
        //ÎïÁÏÊôÐÔ-Íø¸ñ 
 | 
        public static void SetGridByErpCls_CLD(DataGridView grdMain, int i, int HErpClsIDCol, int HErpClsNameCol) 
 | 
        { 
 | 
  
 | 
            //DAL.ClsCLD_ErpCls_View oErpCls = new DAL.ClsCLD_ErpCls_View(); 
 | 
            //if (oErpCls.RefreshView()) 
 | 
            //{ 
 | 
            //    if (oErpCls.GetInfoByID(oErpCls.oModel.HItemID)) 
 | 
            //    { 
 | 
            //        grdMain.Rows[i].Cells[HErpClsIDCol].Value = oErpCls.omodel.HItemID.ToString(); 
 | 
            //        grdMain.Rows[i].Cells[HErpClsNameCol].Value = oErpCls.omodel.HName; 
 | 
            //    } 
 | 
            //    else 
 | 
            //    { 
 | 
            //        grdMain.Rows[i].Cells[HErpClsIDCol].Value = "0"; 
 | 
            //        grdMain.Rows[i].Cells[HErpClsNameCol].Value = ""; 
 | 
            //    } 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    grdMain.Rows[i].Cells[HErpClsIDCol].Value = "0"; 
 | 
            //    grdMain.Rows[i].Cells[HErpClsNameCol].Value = ""; 
 | 
            //} 
 | 
        } 
 | 
  
 | 
  
 | 
        //²¿ÃÅ-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ²¿ÃÅ-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HDeptIDCol"></param> 
 | 
        /// <param name="HDeptNumberCol"></param> 
 | 
        /// <param name="HDeptNameCol"></param> 
 | 
        public static void SetGridByDept_CLD(DataGridView grdMain, int i, int HDeptIDCol, int HDeptNumberCol, int HDeptNameCol) 
 | 
        { 
 | 
  
 | 
            DAL.ClsCLD_Department_View oDept = new DAL.ClsCLD_Department_View(); 
 | 
            if (oDept.RefreshView()) 
 | 
            { 
 | 
                if (oDept.GetInfoByID(oDept.oModel.HItemID)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HDeptIDCol].Value = oDept.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HDeptNumberCol].Value = oDept.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HDeptNameCol].Value = oDept.omodel.HName; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HDeptIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HDeptNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HDeptNameCol].Value = ""; 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                grdMain.Rows[i].Cells[HDeptIDCol].Value = "0"; 
 | 
                grdMain.Rows[i].Cells[HDeptNumberCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HDeptNameCol].Value = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
          
 | 
        //ÎïÁÏ·ÖÀà-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ÎïÁÏ·ÖÀà-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HMaterTypeIDCol"></param> 
 | 
        /// <param name="HMaterTypeNumberCol"></param> 
 | 
        /// <param name="HMaterTypeNameCol"></param> 
 | 
        public static void SetGridByMaterType_CLD(DataGridView grdMain, int i, int HMaterTypeIDCol, int HMaterTypeNumberCol, int HMaterTypeNameCol) 
 | 
        { 
 | 
  
 | 
            //DAL.ClsCLD_MaterType_View oMaterType = new DAL.ClsCLD_MaterType_View(); 
 | 
            //if (oMaterType.RefreshView()) 
 | 
            //{ 
 | 
            //    if (oMaterType.GetInfoByID(oMaterType.oModel.HItemID)) 
 | 
            //    { 
 | 
            //        grdMain.Rows[i].Cells[HMaterTypeIDCol].Value = oMaterType.omodel.HItemID.ToString(); 
 | 
            //        grdMain.Rows[i].Cells[HMaterTypeNumberCol].Value = oMaterType.omodel.HNumber; 
 | 
            //        grdMain.Rows[i].Cells[HMaterTypeNameCol].Value = oMaterType.omodel.HName; 
 | 
            //    } 
 | 
            //    else 
 | 
            //    { 
 | 
            //        grdMain.Rows[i].Cells[HMaterTypeIDCol].Value = "0"; 
 | 
            //        grdMain.Rows[i].Cells[HMaterTypeNumberCol].Value = ""; 
 | 
            //        grdMain.Rows[i].Cells[HMaterTypeNameCol].Value = ""; 
 | 
            //    } 
 | 
            //} 
 | 
            //else 
 | 
            //{ 
 | 
            //    grdMain.Rows[i].Cells[HMaterTypeIDCol].Value = "0"; 
 | 
            //    grdMain.Rows[i].Cells[HMaterTypeNumberCol].Value = ""; 
 | 
            //    grdMain.Rows[i].Cells[HMaterTypeNameCol].Value = ""; 
 | 
            //} 
 | 
        } 
 | 
  
 | 
         
 | 
  
 | 
        //¹©Ó¦ÉÌ-Íø¸ñ 
 | 
        /// <summary> 
 | 
        /// ¹©Ó¦ÉÌ-Íø¸ñ 
 | 
        /// </summary> 
 | 
        /// <param name="grdMain"></param> 
 | 
        /// <param name="i"></param> 
 | 
        /// <param name="HSupIDCol"></param> 
 | 
        /// <param name="HSupNumberCol"></param> 
 | 
        /// <param name="HSupNameCol"></param> 
 | 
        public static void SetGridBySup_CLD(DataGridView grdMain, int i, int HSupIDCol, int HSupNumberCol, int HSupNameCol) 
 | 
        { 
 | 
  
 | 
            DAL.ClsCLD_Supplier_View oSup = new DAL.ClsCLD_Supplier_View(); 
 | 
            if (oSup.RefreshView()) 
 | 
            { 
 | 
                if (oSup.GetInfoByID(oSup.oModel.HItemID)) 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HSupIDCol].Value = oSup.omodel.HItemID.ToString(); 
 | 
                    grdMain.Rows[i].Cells[HSupNumberCol].Value = oSup.omodel.HNumber; 
 | 
                    grdMain.Rows[i].Cells[HSupNameCol].Value = oSup.omodel.HName; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    grdMain.Rows[i].Cells[HSupIDCol].Value = "0"; 
 | 
                    grdMain.Rows[i].Cells[HSupNumberCol].Value = ""; 
 | 
                    grdMain.Rows[i].Cells[HSupNameCol].Value = ""; 
 | 
                } 
 | 
            } 
 | 
            else 
 | 
            { 
 | 
                grdMain.Rows[i].Cells[HSupIDCol].Value = "0"; 
 | 
                grdMain.Rows[i].Cells[HSupNumberCol].Value = ""; 
 | 
                grdMain.Rows[i].Cells[HSupNameCol].Value = ""; 
 | 
            } 
 | 
        } 
 | 
  
 | 
  
 | 
        #endregion 
 | 
    } 
 | 
} 
 |