using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { /// /// IC卡管理 /// public class ClsGy_ICCard_View:DBUtility.ClsGy_Base_View { // public Model.ClsGy_ICCard_Model omodel = new Model.ClsGy_ICCard_Model(); SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); public ClsGy_ICCard_View() { base.MvarReportTitle = "IC卡管理设置"; base.MvarItemKey = "Gy_ICCard"; base.SQLName = "Select HItemID,HCardNo IC卡号,HCardID IC卡内码 from Gy_ICCard where HStopflag=0 Order by HItemID "; } // public void Dispose() { GC.SuppressFinalize(this); } // //返回项目信息 public override bool GetInfoByID(Int64 sItemID) { DataSet DS ; try { DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HItemID='" + 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 HCardNo='" + 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_ICCard_Model(); omodel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); omodel.HCardNo = DS.Tables[0].Rows[0]["HCardNo"].ToString().Trim(); omodel.HCardID = Convert.ToInt64(DS.Tables[0].Rows[0]["HCardID"]); omodel.HEmpID = Convert.ToInt64(DS.Tables[0].Rows[0]["HEmpID"]); omodel.HRemark = DS.Tables[0].Rows[0]["HRemark"].ToString().Trim(); omodel.HMaker = DS.Tables[0].Rows[0]["HMaker"].ToString().Trim(); omodel.HCardType = DS.Tables[0].Rows[0]["HCardType"].ToString().Trim(); omodel.HMakeDate = Convert.ToDateTime(DS.Tables[0].Rows[0]["HMakeDate"]); omodel.HStopflag = (bool)DS.Tables[0].Rows[0]["HStopflag"]; omodel.HK3UserID = Convert.ToInt64(DS.Tables[0].Rows[0]["HK3UserID"]); return true; } catch (Exception e) { throw (e); } } } }