/// <summary> /// 获取客户对象实例 /// </summary> /// <param name="KHId">ID</param> /// <returns>DAO.KEHU</returns> public DAO.KEHU GetModel(string KHId) { DataSet myData = DBUtility.DBHelperSQL.Query("select * from db_kehu where kh_id=" + KHId); DAO.KEHU myModel = new DAO.KEHU(); myModel.KHid = KHId; myModel.KHname = myData.Tables[0].Rows[0]["kh_name"].ToString().Trim(); myModel.KHtype = myData.Tables[0].Rows[0]["kh_type"].ToString().Trim(); myModel.KHaddress = myData.Tables[0].Rows[0]["kh_address"].ToString().Trim(); myModel.KHtell = myData.Tables[0].Rows[0]["kh_tell"].ToString().Trim(); myModel.KHnote = myData.Tables[0].Rows[0]["kh_note"].ToString().Trim(); return myModel; }
/// <summary> /// 设置客户对象实例 /// </summary> /// <param name="KHId">ID</param> /// <param name="KHName">客户名称</param> /// <param name="KHType">类型(供货单位、收货单位)</param> /// <param name="KHaddress">地址</param> /// <param name="KHtell">电话</param> /// <param name="KHnote">备注</param> /// <returns>DAO.KEHU</returns> public DAO.KEHU SetModel(string KHId, string KHName, string KHType, string KHaddress, string KHtell, string KHnote) { DAO.KEHU myModel = new DAO.KEHU(); myModel.KHid = KHId; myModel.KHname = KHName; myModel.KHtype = KHType; myModel.KHaddress = KHaddress; myModel.KHtell = KHtell; myModel.KHnote = KHnote; return myModel; }