using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsGy_QCCheckProject_View:DBUtility.ClsGy_Base_View { // public Model.ClsGy_QCCheckProjectMain omodel = new Model.ClsGy_QCCheckProjectMain(); SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); public ClsGy_QCCheckProject_View() { base.ViewNameForWeb = "h_v_Gy_QCCheckProject_ForWeb"; base.MvarReportTitle = "检验方案"; base.MvarItemKey = "Gy_QCCheckProjectMain"; base.SQLName = "Select HinterID HItemID,HBillNo 检验方案代码,HName 方案名称 from Gy_QCCheckProjectMain Order by HinterID "; //下拉SQL base.SQLNameForDown = " Select top 30 HItemID,HNumber 部门代码,HName 部门 from Gy_QCCheckProjectMain "; base.SQLOrderForDown = " Order by HNumber "; base.SQLWhereForDown = " where HStopflag=0 "; } // public void Dispose() { GC.SuppressFinalize(this); } // //返回项目信息 public override bool GetInfoByID(Int64 sItemID) { DataSet DS ; try { DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HinterID='" + sItemID + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo); if (DS.Tables[0].Rows.Count == 0) return false; else { return GetInfo(DS); } } catch (Exception e) { throw (e); } } //根据代码返回项目信息 public override bool GetInfoByNumber(string sNumber) { DataSet DS; try { DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HBillNo='" + sNumber + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo); if (DS.Tables[0].Rows.Count == 0) return false; else { return GetInfo(DS); } } catch (Exception e) { throw (e); } } //返回项目信息 public override bool GetInfo(DataSet DS) { try { omodel = new Model.ClsGy_QCCheckProjectMain(); omodel.HInterID = Convert.ToInt64(DS.Tables[0].Rows[0]["HInterID"]); omodel.HBillNo = DS.Tables[0].Rows[0]["HBillNo"].ToString().Trim(); omodel.HName = DS.Tables[0].Rows[0]["HName"].ToString().Trim(); return true; } catch (Exception e) { throw (e); } } } }