Esempio n. 1
0
        public virtual bool AddSupplierTag(SupplierTagInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

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

            DrAdd["Supplier_Tag_ID"]      = entity.Supplier_Tag_ID;
            DrAdd["Supplier_Tag_Name"]    = entity.Supplier_Tag_Name;
            DrAdd["Supplier_Tag_Img"]     = entity.Supplier_Tag_Img;
            DrAdd["Supplier_Tag_Content"] = entity.Supplier_Tag_Content;
            DrAdd["Supplier_Tag_Site"]    = entity.Supplier_Tag_Site;

            DtAdd.Rows.Add(DrAdd);
            try
            {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
        }
Esempio n. 2
0
 public virtual bool EditSupplierTag(SupplierTagInfo entity, RBACUserInfo UserPrivilege)
 {
     if (RBAC.CheckPrivilege(UserPrivilege, "a6691534-a5e6-4636-901b-88a62ea1acc1"))
     {
         return(MyDAL.EditSupplierTag(entity));
     }
     else
     {
         throw new TradePrivilegeException("没有权限,权限代码:a6691534-a5e6-4636-901b-88a62ea1acc1错误");
     }
 }
Esempio n. 3
0
 public virtual bool AddSupplierTag(SupplierTagInfo entity, RBACUserInfo UserPrivilege)
 {
     if (RBAC.CheckPrivilege(UserPrivilege, "da202dcc-2dba-4d0b-829f-d170541a1e80"))
     {
         return(MyDAL.AddSupplierTag(entity));
     }
     else
     {
         throw new TradePrivilegeException("没有权限,权限代码:da202dcc-2dba-4d0b-829f-d170541a1e80错误");
     }
 }
Esempio n. 4
0
        public virtual IList <SupplierTagInfo> GetSupplierTags(QueryInfo Query)
        {
            int PageSize;
            int CurrentPage;
            IList <SupplierTagInfo> entitys = null;
            SupplierTagInfo         entity = null;
            string        SqlList, SqlField, SqlOrder, SqlParam, SqlTable;
            SqlDataReader RdrList = null;

            try
            {
                CurrentPage = Query.CurrentPage;
                PageSize    = Query.PageSize;
                SqlTable    = "Supplier_Tag";
                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 <SupplierTagInfo>();
                    while (RdrList.Read())
                    {
                        entity = new SupplierTagInfo();
                        entity.Supplier_Tag_ID      = Tools.NullInt(RdrList["Supplier_Tag_ID"]);
                        entity.Supplier_Tag_Name    = Tools.NullStr(RdrList["Supplier_Tag_Name"]);
                        entity.Supplier_Tag_Img     = Tools.NullStr(RdrList["Supplier_Tag_Img"]);
                        entity.Supplier_Tag_Content = Tools.NullStr(RdrList["Supplier_Tag_Content"]);
                        entity.Supplier_Tag_Site    = Tools.NullStr(RdrList["Supplier_Tag_Site"]);

                        entitys.Add(entity);
                        entity = null;
                    }
                }
                return(entitys);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Esempio n. 5
0
        public virtual bool EditSupplierTag(SupplierTagInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Supplier_Tag WHERE Supplier_Tag_ID = " + entity.Supplier_Tag_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try
            {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Supplier_Tag_ID"]      = entity.Supplier_Tag_ID;
                    DrAdd["Supplier_Tag_Name"]    = entity.Supplier_Tag_Name;
                    DrAdd["Supplier_Tag_Img"]     = entity.Supplier_Tag_Img;
                    DrAdd["Supplier_Tag_Content"] = entity.Supplier_Tag_Content;
                    DrAdd["Supplier_Tag_Site"]    = entity.Supplier_Tag_Site;

                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
            return(true);
        }
Esempio n. 6
0
        public virtual SupplierTagInfo GetSupplierTagByID(int ID)
        {
            SupplierTagInfo entity  = null;
            SqlDataReader   RdrList = null;

            try
            {
                string SqlList;
                SqlList = "SELECT * FROM Supplier_Tag WHERE Supplier_Tag_ID = " + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity = new SupplierTagInfo();

                    entity.Supplier_Tag_ID      = Tools.NullInt(RdrList["Supplier_Tag_ID"]);
                    entity.Supplier_Tag_Name    = Tools.NullStr(RdrList["Supplier_Tag_Name"]);
                    entity.Supplier_Tag_Img     = Tools.NullStr(RdrList["Supplier_Tag_Img"]);
                    entity.Supplier_Tag_Content = Tools.NullStr(RdrList["Supplier_Tag_Content"]);
                    entity.Supplier_Tag_Site    = Tools.NullStr(RdrList["Supplier_Tag_Site"]);
                }

                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }