public virtual bool AddSupplierRelateTag(SupplierRelateTagInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT TOP 0 * FROM Supplier_RelateTag"; DtAdd = DBHelper.Query(SqlAdd); DrAdd = DtAdd.NewRow(); DrAdd["Supplier_RelateTag_ID"] = entity.Supplier_RelateTag_ID; DrAdd["Supplier_RelateTag_SupplierID"] = entity.Supplier_RelateTag_SupplierID; DrAdd["Supplier_RelateTag_TagID"] = entity.Supplier_RelateTag_TagID; DtAdd.Rows.Add(DrAdd); try { DBHelper.SaveChanges(SqlAdd, DtAdd); return(true); } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } }
public virtual IList <SupplierRelateTagInfo> GetSupplierRelateTagsBySupplierID(int Supplier_ID) { IList <SupplierRelateTagInfo> entitys = null; SupplierRelateTagInfo entity = null; string SqlList; SqlDataReader RdrList = null; try { SqlList = "Select * FROM Supplier_RelateTag WHERE Supplier_RelateTag_SupplierID = " + Supplier_ID; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.HasRows) { entitys = new List <SupplierRelateTagInfo>(); while (RdrList.Read()) { entity = new SupplierRelateTagInfo(); entity.Supplier_RelateTag_ID = Tools.NullInt(RdrList["Supplier_RelateTag_ID"]); entity.Supplier_RelateTag_SupplierID = Tools.NullInt(RdrList["Supplier_RelateTag_SupplierID"]); entity.Supplier_RelateTag_TagID = Tools.NullInt(RdrList["Supplier_RelateTag_TagID"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool AddSupplierRelateTag(SupplierRelateTagInfo entity) { return(MyDAL.AddSupplierRelateTag(entity)); }