Exemple #1
0
        public virtual IList <SupplierShopEvaluateInfo> GetSupplierShopEvaluates(QueryInfo Query)
        {
            int PageSize;
            int CurrentPage;
            IList <SupplierShopEvaluateInfo> entitys = null;
            SupplierShopEvaluateInfo         entity = null;
            string        SqlList, SqlField, SqlOrder, SqlParam, SqlTable;
            SqlDataReader RdrList = null;

            try
            {
                CurrentPage = Query.CurrentPage;
                PageSize    = Query.PageSize;
                SqlTable    = "Supplier_Shop_Evaluate";
                SqlField    = "*";
                SqlParam    = DBHelper.GetSqlParam(Query.ParamInfos);
                SqlOrder    = DBHelper.GetSqlOrder(Query.OrderInfos);
                SqlList     = DBHelper.GetSqlPage(SqlTable, SqlField, SqlParam, SqlOrder, CurrentPage, PageSize);
                RdrList     = DBHelper.ExecuteReader(SqlList);
                if (RdrList.HasRows)
                {
                    entitys = new List <SupplierShopEvaluateInfo>();
                    while (RdrList.Read())
                    {
                        entity = new SupplierShopEvaluateInfo();
                        entity.Shop_Evaluate_ID         = Tools.NullInt(RdrList["Shop_Evaluate_ID"]);
                        entity.Shop_Evaluate_SupplierID = Tools.NullInt(RdrList["Shop_Evaluate_SupplierID"]);
                        entity.Shop_Evaluate_ContractID = Tools.NullInt(RdrList["Shop_Evaluate_ContractID"]);
                        entity.Shop_Evaluate_Productid  = Tools.NullInt(RdrList["Shop_Evaluate_Productid"]);
                        entity.Shop_Evaluate_MemberID   = Tools.NullInt(RdrList["Shop_Evaluate_MemberId"]);
                        entity.Shop_Evaluate_Product    = Tools.NullInt(RdrList["Shop_Evaluate_Product"]);
                        entity.Shop_Evaluate_Service    = Tools.NullInt(RdrList["Shop_Evaluate_Service"]);
                        entity.Shop_Evaluate_Delivery   = Tools.NullInt(RdrList["Shop_Evaluate_Delivery"]);
                        entity.Shop_Evaluate_Note       = Tools.NullStr(RdrList["Shop_Evaluate_Note"]);
                        entity.Shop_Evaluate_Ischeck    = Tools.NullInt(RdrList["Shop_Evaluate_Ischeck"]);
                        entity.Shop_Evaluate_Recommend  = Tools.NullInt(RdrList["Shop_Evaluate_Recommend"]);
                        entity.Shop_Evaluate_IsGift     = Tools.NullInt(RdrList["Shop_Evaluate_IsGift"]);
                        entity.Shop_Evaluate_Addtime    = Tools.NullDate(RdrList["Shop_Evaluate_Addtime"]);
                        entity.Shop_Evaluate_Site       = Tools.NullStr(RdrList["Shop_Evaluate_Site"]);

                        entitys.Add(entity);
                        entity = null;
                    }
                }
                return(entitys);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Exemple #2
0
        public virtual bool EditSupplierShopEvaluate(SupplierShopEvaluateInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Supplier_Shop_Evaluate WHERE Shop_Evaluate_ID = " + entity.Shop_Evaluate_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try
            {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Shop_Evaluate_ID"]         = entity.Shop_Evaluate_ID;
                    DrAdd["Shop_Evaluate_SupplierID"] = entity.Shop_Evaluate_SupplierID;
                    DrAdd["Shop_Evaluate_ContractID"] = entity.Shop_Evaluate_ContractID;
                    DrAdd["Shop_Evaluate_Productid"]  = entity.Shop_Evaluate_Productid;
                    DrAdd["Shop_Evaluate_MemberId"]   = entity.Shop_Evaluate_MemberID;
                    DrAdd["Shop_Evaluate_Product"]    = entity.Shop_Evaluate_Product;
                    DrAdd["Shop_Evaluate_Service"]    = entity.Shop_Evaluate_Service;
                    DrAdd["Shop_Evaluate_Delivery"]   = entity.Shop_Evaluate_Delivery;
                    DrAdd["Shop_Evaluate_Note"]       = entity.Shop_Evaluate_Note;
                    DrAdd["Shop_Evaluate_Ischeck"]    = entity.Shop_Evaluate_Ischeck;
                    DrAdd["Shop_Evaluate_Recommend"]  = entity.Shop_Evaluate_Recommend;
                    DrAdd["Shop_Evaluate_IsGift"]     = entity.Shop_Evaluate_IsGift;
                    DrAdd["Shop_Evaluate_Addtime"]    = entity.Shop_Evaluate_Addtime;
                    DrAdd["Shop_Evaluate_Site"]       = entity.Shop_Evaluate_Site;

                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
            return(true);
        }
Exemple #3
0
        public virtual SupplierShopEvaluateInfo GetSupplierShopEvaluateByID(int ID)
        {
            SupplierShopEvaluateInfo entity  = null;
            SqlDataReader            RdrList = null;

            try
            {
                string SqlList;
                SqlList = "SELECT * FROM Supplier_Shop_Evaluate WHERE Shop_Evaluate_ID = " + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity = new SupplierShopEvaluateInfo();

                    entity.Shop_Evaluate_ID         = Tools.NullInt(RdrList["Shop_Evaluate_ID"]);
                    entity.Shop_Evaluate_SupplierID = Tools.NullInt(RdrList["Shop_Evaluate_SupplierID"]);
                    entity.Shop_Evaluate_ContractID = Tools.NullInt(RdrList["Shop_Evaluate_ContractID"]);
                    entity.Shop_Evaluate_Productid  = Tools.NullInt(RdrList["Shop_Evaluate_Productid"]);
                    entity.Shop_Evaluate_MemberID   = Tools.NullInt(RdrList["Shop_Evaluate_MemberId"]);
                    entity.Shop_Evaluate_Product    = Tools.NullInt(RdrList["Shop_Evaluate_Product"]);
                    entity.Shop_Evaluate_Service    = Tools.NullInt(RdrList["Shop_Evaluate_Service"]);
                    entity.Shop_Evaluate_Delivery   = Tools.NullInt(RdrList["Shop_Evaluate_Delivery"]);
                    entity.Shop_Evaluate_Note       = Tools.NullStr(RdrList["Shop_Evaluate_Note"]);
                    entity.Shop_Evaluate_Ischeck    = Tools.NullInt(RdrList["Shop_Evaluate_Ischeck"]);
                    entity.Shop_Evaluate_Recommend  = Tools.NullInt(RdrList["Shop_Evaluate_Recommend"]);
                    entity.Shop_Evaluate_IsGift     = Tools.NullInt(RdrList["Shop_Evaluate_IsGift"]);
                    entity.Shop_Evaluate_Addtime    = Tools.NullDate(RdrList["Shop_Evaluate_Addtime"]);
                    entity.Shop_Evaluate_Site       = Tools.NullStr(RdrList["Shop_Evaluate_Site"]);
                }

                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Exemple #4
0
        public virtual bool AddSupplierShopEvaluate(SupplierShopEvaluateInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

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

            DrAdd["Shop_Evaluate_ID"]         = entity.Shop_Evaluate_ID;
            DrAdd["Shop_Evaluate_SupplierID"] = entity.Shop_Evaluate_SupplierID;
            DrAdd["Shop_Evaluate_ContractID"] = entity.Shop_Evaluate_ContractID;
            DrAdd["Shop_Evaluate_Productid"]  = entity.Shop_Evaluate_Productid;
            DrAdd["Shop_Evaluate_MemberId"]   = entity.Shop_Evaluate_MemberID;
            DrAdd["Shop_Evaluate_Product"]    = entity.Shop_Evaluate_Product;
            DrAdd["Shop_Evaluate_Service"]    = entity.Shop_Evaluate_Service;
            DrAdd["Shop_Evaluate_Delivery"]   = entity.Shop_Evaluate_Delivery;
            DrAdd["Shop_Evaluate_Note"]       = entity.Shop_Evaluate_Note;
            DrAdd["Shop_Evaluate_Ischeck"]    = entity.Shop_Evaluate_Ischeck;
            DrAdd["Shop_Evaluate_Recommend"]  = entity.Shop_Evaluate_Recommend;
            DrAdd["Shop_Evaluate_IsGift"]     = entity.Shop_Evaluate_IsGift;
            DrAdd["Shop_Evaluate_Addtime"]    = entity.Shop_Evaluate_Addtime;
            DrAdd["Shop_Evaluate_Site"]       = entity.Shop_Evaluate_Site;

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