using System; 
 | 
using System.Collections.Generic; 
 | 
using System.Text; 
 | 
using DBUtility; 
 | 
  
 | 
namespace DAL 
 | 
{ 
 | 
    public class Cls_S_Sc_ICMOSortBill 
 | 
    { 
 | 
        private string mvarReportTitle; 
 | 
        public string MvarReportTitle 
 | 
        { 
 | 
            get { return mvarReportTitle; } 
 | 
            set { mvarReportTitle = value; } 
 | 
        } 
 | 
        private string mvarItemKey; 
 | 
        public string MvarItemKey 
 | 
        { 
 | 
            get { return mvarItemKey; } 
 | 
            set { mvarItemKey = value; } 
 | 
        } 
 | 
        frmHlpBillList oFrm = new frmHlpBillList(); 
 | 
        const string ViewName = "h_v_Sc_ICMOSortBillHisList_Source"; 
 | 
        public List<DBUtility.BillSelect> oBillSelectColl = new List<DBUtility.BillSelect>(); 
 | 
        // 
 | 
        public Cls_S_Sc_ICMOSortBill() 
 | 
        { 
 | 
            mvarReportTitle = "生产派工单"; 
 | 
            mvarItemKey = "3708"; 
 | 
        } 
 | 
        // 
 | 
        public bool Refresh(string sWhere) 
 | 
        { 
 | 
            string sErr = ""; 
 | 
            int MainIDCol, SubIDCol, BillNoCol; 
 | 
            string tSQL; 
 | 
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); 
 | 
            tSQL = sWhere + " and HRelationQty<本日计划数 and HDeleteMan='' order by 日期,hsubid "; 
 | 
            try 
 | 
            { 
 | 
                oFrm.sPrimaryCol = "部门"; 
 | 
                oFrm.Text = mvarReportTitle; 
 | 
                oFrm.lblCaption.Text = mvarReportTitle; 
 | 
                oFrm.tSQL = tSQL; 
 | 
                oFrm.ViewName = ViewName; 
 | 
                oFrm.ShowDialog(); 
 | 
                //返回数据到集合中 
 | 
                oBillSelectColl.Clear(); 
 | 
                MainIDCol = oFrm.Fun_GetCol("hmainid"); 
 | 
                SubIDCol = oFrm.Fun_GetCol("hsubid"); 
 | 
                BillNoCol = oFrm.Fun_GetCol("单据号"); 
 | 
                int SelectCol = oFrm.Fun_GetCol("选择"); 
 | 
                // 
 | 
                for (int i = oFrm.grdMain.FixedRows; i < oFrm.grdMain.Rows - 1; i++) 
 | 
                { 
 | 
                    if (DBUtility.ClsPub.isStrNull( oFrm.grdMain.get_TextMatrix(i, SelectCol)) == "*") 
 | 
                    { 
 | 
                        DBUtility.BillSelect oSelect = new DBUtility.BillSelect(); 
 | 
                        oSelect.BillNo = DBUtility.ClsPub.isStrNull(oFrm.grdMain.get_TextMatrix(i, BillNoCol)); 
 | 
                        oSelect.BillMainID = DBUtility.ClsPub.isLong(oFrm.grdMain.get_TextMatrix(i, MainIDCol)); 
 | 
                        oSelect.BillSubID = DBUtility.ClsPub.isLong(oFrm.grdMain.get_TextMatrix(i, SubIDCol)); 
 | 
                        oSelect.BillTitle = mvarReportTitle; 
 | 
                        oSelect.BillType = mvarItemKey; 
 | 
                        oBillSelectColl.Add(oSelect); 
 | 
                    } 
 | 
                } 
 | 
                // 
 | 
                if (oBillSelectColl.Count > 0) 
 | 
                    return true; 
 | 
                else 
 | 
                    return false; 
 | 
            } 
 | 
            catch (Exception e) 
 | 
            { 
 | 
                sErr = e.Message; 
 | 
            } 
 | 
            return true; 
 | 
        } 
 | 
        // 
 | 
  
 | 
        public bool Refresh_History(string sWhere) 
 | 
        { 
 | 
            string sErr = ""; 
 | 
            int MainIDCol, SubIDCol, BillNoCol; 
 | 
            string tSQL; 
 | 
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); 
 | 
            tSQL = sWhere + " and HRelationQty<本日计划数 order by 日期,hsubid "; 
 | 
            try 
 | 
            { 
 | 
                oFrm.sPrimaryCol = "部门"; 
 | 
                oFrm.Text = mvarReportTitle; 
 | 
                oFrm.lblCaption.Text = mvarReportTitle; 
 | 
                oFrm.tSQL = tSQL; 
 | 
                oFrm.ViewName = ViewName; 
 | 
                oFrm.ShowDialog(); 
 | 
                //返回数据到集合中 
 | 
                oBillSelectColl.Clear(); 
 | 
                MainIDCol = oFrm.Fun_GetCol("hmainid"); 
 | 
                SubIDCol = oFrm.Fun_GetCol("hsubid"); 
 | 
                BillNoCol = oFrm.Fun_GetCol("单据号"); 
 | 
                int SelectCol = oFrm.Fun_GetCol("选择"); 
 | 
                // 
 | 
                for (int i = oFrm.grdMain.FixedRows; i < oFrm.grdMain.Rows - 1; i++) 
 | 
                { 
 | 
                    if (DBUtility.ClsPub.isStrNull(oFrm.grdMain.get_TextMatrix(i, SelectCol)) == "*") 
 | 
                    { 
 | 
                        DBUtility.BillSelect oSelect = new DBUtility.BillSelect(); 
 | 
                        oSelect.BillNo = DBUtility.ClsPub.isStrNull(oFrm.grdMain.get_TextMatrix(i, BillNoCol)); 
 | 
                        oSelect.BillMainID = DBUtility.ClsPub.isLong(oFrm.grdMain.get_TextMatrix(i, MainIDCol)); 
 | 
                        oSelect.BillSubID = DBUtility.ClsPub.isLong(oFrm.grdMain.get_TextMatrix(i, SubIDCol)); 
 | 
                        oSelect.BillTitle = mvarReportTitle; 
 | 
                        oSelect.BillType = mvarItemKey; 
 | 
                        oBillSelectColl.Add(oSelect); 
 | 
                    } 
 | 
                } 
 | 
                // 
 | 
                if (oBillSelectColl.Count > 0) 
 | 
                    return true; 
 | 
                else 
 | 
                    return false; 
 | 
            } 
 | 
            catch (Exception e) 
 | 
            { 
 | 
                sErr = e.Message; 
 | 
            } 
 | 
            return true; 
 | 
        } 
 | 
  
 | 
  
 | 
         
 | 
    } 
 | 
} 
 |