public virtual bool EditOrdersBackApplyProduct(OrdersBackApplyProductInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Orders_BackApply_Product WHERE Orders_BackApply_Product_ID = " + entity.Orders_BackApply_Product_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try
            {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Orders_BackApply_Product_ID"]          = entity.Orders_BackApply_Product_ID;
                    DrAdd["Orders_BackApply_Product_ProductID"]   = entity.Orders_BackApply_Product_ProductID;
                    DrAdd["Orders_BackApply_Product_ApplyID"]     = entity.Orders_BackApply_Product_ApplyID;
                    DrAdd["Orders_BackApply_Product_ApplyAmount"] = entity.Orders_BackApply_Product_ApplyAmount;
                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
            return(true);
        }
        public virtual OrdersBackApplyProductInfo GetOrdersBackApplyProductByID(int ID)
        {
            OrdersBackApplyProductInfo entity = null;
            SqlDataReader RdrList             = null;

            try
            {
                string SqlList;
                SqlList = "SELECT * FROM Orders_BackApply_Product WHERE Orders_BackApply_Product_ID = " + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity = new OrdersBackApplyProductInfo();

                    entity.Orders_BackApply_Product_ID          = Tools.NullInt(RdrList["Orders_BackApply_Product_ID"]);
                    entity.Orders_BackApply_Product_ProductID   = Tools.NullInt(RdrList["Orders_BackApply_Product_ProductID"]);
                    entity.Orders_BackApply_Product_ApplyID     = Tools.NullInt(RdrList["Orders_BackApply_Product_ApplyID"]);
                    entity.Orders_BackApply_Product_ApplyAmount = Tools.NullInt(RdrList["Orders_BackApply_Product_ApplyAmount"]);
                }

                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
        public virtual bool AddOrdersBackApplyProduct(OrdersBackApplyProductInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

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

            DrAdd["Orders_BackApply_Product_ID"]          = entity.Orders_BackApply_Product_ID;
            DrAdd["Orders_BackApply_Product_ProductID"]   = entity.Orders_BackApply_Product_ProductID;
            DrAdd["Orders_BackApply_Product_ApplyID"]     = entity.Orders_BackApply_Product_ApplyID;
            DrAdd["Orders_BackApply_Product_ApplyAmount"] = entity.Orders_BackApply_Product_ApplyAmount;


            DtAdd.Rows.Add(DrAdd);
            try
            {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
        }
 public virtual bool EditOrdersBackApplyProduct(OrdersBackApplyProductInfo entity)
 {
     return(MyDAL.EditOrdersBackApplyProduct(entity));
 }