コード例 #1
0
        public virtual bool AddSupplierPurchasePrivate(SupplierPurchasePrivateInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT TOP 0 * FROM Supplier_Purchase_Private";
            DtAdd  = DBHelper.Query(SqlAdd);
            DrAdd  = DtAdd.NewRow();

            DrAdd["Purchase_Private_ID"]         = entity.Purchase_Private_ID;
            DrAdd["Purchase_Private_SupplierID"] = entity.Purchase_Private_SupplierID;
            DrAdd["Purchase_Private_PurchaseID"] = entity.Purchase_Private_PurchaseID;

            DtAdd.Rows.Add(DrAdd);
            try
            {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
        }
コード例 #2
0
        public virtual IList <SupplierPurchasePrivateInfo> GetSupplierPurchasePrivatesByPurchase(int ID)
        {
            IList <SupplierPurchasePrivateInfo> entitys = null;
            SupplierPurchasePrivateInfo         entity  = null;
            string        SqlList;
            SqlDataReader RdrList = null;

            try
            {
                SqlList = "select * from Supplier_Purchase_Private where Purchase_Private_PurchaseID=" + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.HasRows)
                {
                    entitys = new List <SupplierPurchasePrivateInfo>();
                    while (RdrList.Read())
                    {
                        entity = new SupplierPurchasePrivateInfo();
                        entity.Purchase_Private_ID         = Tools.NullInt(RdrList["Purchase_Private_ID"]);
                        entity.Purchase_Private_SupplierID = Tools.NullInt(RdrList["Purchase_Private_SupplierID"]);
                        entity.Purchase_Private_PurchaseID = Tools.NullInt(RdrList["Purchase_Private_PurchaseID"]);

                        entitys.Add(entity);
                        entity = null;
                    }
                }
                return(entitys);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
コード例 #3
0
 public virtual bool AddSupplierPurchasePrivate(SupplierPurchasePrivateInfo entity)
 {
     return(MyDAL.AddSupplierPurchasePrivate(entity));
 }