Пример #1
0
        public virtual bool AddProductDenyReason(ProductDenyReasonInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

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

            DrAdd["Product_Deny_Reason_ID"]            = entity.Product_Deny_Reason_ID;
            DrAdd["Product_Deny_Reason_ProductID"]     = entity.Product_Deny_Reason_ProductID;
            DrAdd["Product_Deny_Reason_AuditReasonID"] = entity.Product_Deny_Reason_AuditReasonID;

            DtAdd.Rows.Add(DrAdd);
            try
            {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
        }
Пример #2
0
        public virtual IList <ProductDenyReasonInfo> GetProductDenyReasons(int Product_ID)
        {
            int PageSize;
            int CurrentPage;
            IList <ProductDenyReasonInfo> entitys = null;
            ProductDenyReasonInfo         entity = null;
            string        SqlList, SqlField, SqlOrder, SqlParam, SqlTable;
            SqlDataReader RdrList = null;

            try
            {
                SqlList = "Select * From Product_Deny_Reason Where Product_Deny_Reason_ProductID=" + Product_ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.HasRows)
                {
                    entitys = new List <ProductDenyReasonInfo>();
                    while (RdrList.Read())
                    {
                        entity = new ProductDenyReasonInfo();
                        entity.Product_Deny_Reason_ID            = Tools.NullInt(RdrList["Product_Deny_Reason_ID"]);
                        entity.Product_Deny_Reason_ProductID     = Tools.NullInt(RdrList["Product_Deny_Reason_ProductID"]);
                        entity.Product_Deny_Reason_AuditReasonID = Tools.NullInt(RdrList["Product_Deny_Reason_AuditReasonID"]);

                        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 AddProductDenyReason(ProductDenyReasonInfo entity)
 {
     return(MyDAL.AddProductDenyReason(entity));
 }