public virtual bool EditKeywordBiddingKeyword(KeywordBiddingKeywordInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT * FROM KeywordBidding_Keyword WHERE Keyword_ID = " + entity.Keyword_ID; DtAdd = DBHelper.Query(SqlAdd); try { if (DtAdd.Rows.Count > 0) { DrAdd = DtAdd.Rows[0]; DrAdd["Keyword_ID"] = entity.Keyword_ID; DrAdd["Keyword_Name"] = entity.Keyword_Name; DrAdd["Keyword_MinPrice"] = entity.Keyword_MinPrice; DBHelper.SaveChanges(SqlAdd, DtAdd); } else { return(false); } } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } return(true); }
public virtual KeywordBiddingKeywordInfo GetKeywordBiddingKeywordByName(string Keyword) { KeywordBiddingKeywordInfo entity = null; SqlDataReader RdrList = null; try { string SqlList; SqlList = "SELECT * FROM KeywordBidding_Keyword WHERE Keyword_Name = '" + Keyword + "'"; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.Read()) { entity = new KeywordBiddingKeywordInfo(); entity.Keyword_ID = Tools.NullInt(RdrList["Keyword_ID"]); entity.Keyword_Name = Tools.NullStr(RdrList["Keyword_Name"]); entity.Keyword_MinPrice = Tools.NullDbl(RdrList["Keyword_MinPrice"]); } return(entity); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool AddKeywordBiddingKeyword(KeywordBiddingKeywordInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT TOP 0 * FROM KeywordBidding_Keyword"; DtAdd = DBHelper.Query(SqlAdd); DrAdd = DtAdd.NewRow(); DrAdd["Keyword_ID"] = entity.Keyword_ID; DrAdd["Keyword_Name"] = entity.Keyword_Name; DrAdd["Keyword_MinPrice"] = entity.Keyword_MinPrice; DtAdd.Rows.Add(DrAdd); try { DBHelper.SaveChanges(SqlAdd, DtAdd); return(true); } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } }
public void EditKeywordBidding_Keyword() { int Keyword_ID = tools.CheckInt(Request.Form["Keyword_ID"]); double Keyword_MinPrice = tools.CheckFloat(Request.Form["Keyword_MinPrice"]); if (Keyword_MinPrice == 0) { Public.Msg("error", "错误信息", "请填写起步价", false, "{back}"); return; } KeywordBiddingKeywordInfo entity = GetKeywordBiddingKeywordID(Keyword_ID); if (entity != null) { entity.Keyword_MinPrice = Keyword_MinPrice; if (MyBLL.EditKeywordBiddingKeyword(entity, Public.GetUserPrivilege())) { Public.Msg("positive", "操作成功", "操作成功", true, "keyword_list.aspx"); } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
public virtual bool EditKeywordBiddingKeyword(KeywordBiddingKeywordInfo entity, RBACUserInfo UserPrivilege) { if (RBAC.CheckPrivilege(UserPrivilege, "0f39c533-9740-427f-ae56-649518a414c3")) { return(MyDAL.EditKeywordBiddingKeyword(entity)); } else { throw new TradePrivilegeException("没有权限,权限代码:0f39c533-9740-427f-ae56-649518a414c3错误"); } }
//获取指定竞价关键词 public virtual string GetKeywordBiddingKeywordByID(int Keyword_ID) { string Keyword_Name = ""; KeywordBiddingKeywordInfo entity = MyBLL.GetKeywordBiddingKeywordByID(Keyword_ID, Public.GetUserPrivilege()); if (entity != null) { Keyword_Name = entity.Keyword_Name; } return(Keyword_Name); }
public virtual IList <KeywordBiddingKeywordInfo> GetKeywordBiddingKeywords(QueryInfo Query) { int PageSize; int CurrentPage; IList <KeywordBiddingKeywordInfo> entitys = null; KeywordBiddingKeywordInfo entity = null; string SqlList, SqlField, SqlOrder, SqlParam, SqlTable; SqlDataReader RdrList = null; try { CurrentPage = Query.CurrentPage; PageSize = Query.PageSize; SqlTable = "KeywordBidding_Keyword"; 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 <KeywordBiddingKeywordInfo>(); while (RdrList.Read()) { entity = new KeywordBiddingKeywordInfo(); entity.Keyword_ID = Tools.NullInt(RdrList["Keyword_ID"]); entity.Keyword_Name = Tools.NullStr(RdrList["Keyword_Name"]); entity.Keyword_MinPrice = Tools.NullDbl(RdrList["Keyword_MinPrice"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool AddKeywordBiddingKeyword(KeywordBiddingKeywordInfo entity) { return(MyDAL.AddKeywordBiddingKeyword(entity)); }