public void DelShoppingAsk() { int Ask_ID = tools.CheckInt(Request.QueryString["Ask_ID"]); ShoppingAskInfo entity = GetShoppingAskByID(Ask_ID); if (entity != null) { if (MyBLL.DelShoppingAsk(Ask_ID, Public.GetUserPrivilege()) > 0) { if (entity.Ask_ProductID == 0) { Public.Msg("positive", "操作成功", "操作成功", true, "Shopping_Ask_list.aspx?target=supplier"); } else { Public.Msg("positive", "操作成功", "操作成功", true, "Shopping_Ask_list.aspx"); } } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
public virtual IList <ShoppingAskInfo> GetShoppingAsks(QueryInfo Query) { int PageSize; int CurrentPage; IList <ShoppingAskInfo> entitys = null; ShoppingAskInfo entity = null; string SqlList, SqlField, SqlOrder, SqlParam, SqlTable; SqlDataReader RdrList = null; try { CurrentPage = Query.CurrentPage; PageSize = Query.PageSize; SqlTable = "Shopping_Ask"; 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 <ShoppingAskInfo>(); while (RdrList.Read()) { entity = new ShoppingAskInfo(); entity.Ask_ID = Tools.NullInt(RdrList["Ask_ID"]); entity.Ask_Type = Tools.NullInt(RdrList["Ask_Type"]); entity.Ask_Contact = Tools.NullStr(RdrList["Ask_Contact"]); entity.Ask_Content = Tools.NullStr(RdrList["Ask_Content"]); entity.Ask_Reply = Tools.NullStr(RdrList["Ask_Reply"]); entity.Ask_Addtime = Tools.NullDate(RdrList["Ask_Addtime"]); entity.Ask_SupplierID = Tools.NullInt(RdrList["Ask_SupplierID"]); entity.Ask_MemberID = Tools.NullInt(RdrList["Ask_MemberID"]); entity.Ask_ProductID = Tools.NullInt(RdrList["Ask_ProductID"]); entity.Ask_Pleasurenum = Tools.NullInt(RdrList["Ask_Pleasurenum"]); entity.Ask_Displeasure = Tools.NullInt(RdrList["Ask_Displeasure"]); entity.Ask_Isreply = Tools.NullInt(RdrList["Ask_Isreply"]); entity.Ask_IsCheck = Tools.NullInt(RdrList["Ask_IsCheck"]); entity.Ask_Site = Tools.NullStr(RdrList["Ask_Site"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool EditShoppingAsk(ShoppingAskInfo entity, RBACUserInfo UserPrivilege) { if (RBAC.CheckPrivilege(UserPrivilege, "b2a9d36e-9ba5-45b6-8481-9da1cd12ace0")) { return(MyDAL.EditShoppingAsk(entity)); } else { throw new TradePrivilegeException("没有权限,权限代码:b2a9d36e-9ba5-45b6-8481-9da1cd12ace0错误"); } }
public virtual bool AddShoppingAsk(ShoppingAskInfo entity, RBACUserInfo UserPrivilege) { if (RBAC.CheckPrivilege(UserPrivilege, "7da52156-9a1e-46af-bad4-7611cef159e3")) { return(MyDAL.AddShoppingAsk(entity)); } else { throw new TradePrivilegeException("没有权限,权限代码:7da52156-9a1e-46af-bad4-7611cef159e3错误"); } }
public void EditShoppingAsk() { string target = tools.CheckStr(Request.QueryString["target"]); int Ask_ID = tools.CheckInt(Request.Form["Ask_ID"]); string Ask_Reply = tools.CheckStr(Request.Form["Ask_Reply"]); int Ask_Isreply = 0; if (Ask_Reply == "") { Ask_Isreply = 0; } else { Ask_Isreply = 1; } ShoppingAskInfo entity = MyBLL.GetShoppingAskByID(Ask_ID, Public.GetUserPrivilege()); if (entity != null) { entity.Ask_Reply = Ask_Reply; entity.Ask_Isreply = Ask_Isreply; if (MyBLL.EditShoppingAsk(entity, Public.GetUserPrivilege())) { if (target.Length > 0) { Public.Msg("positive", "操作成功", "操作成功", true, "Shopping_Ask_list.aspx?target=" + target + ""); } else { Public.Msg("positive", "操作成功", "操作成功", true, "Shopping_Ask_list.aspx"); } } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } } else { Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}"); } }
public virtual bool EditShoppingAsk(ShoppingAskInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT * FROM Shopping_Ask WHERE Ask_ID = " + entity.Ask_ID; DtAdd = DBHelper.Query(SqlAdd); try { if (DtAdd.Rows.Count > 0) { DrAdd = DtAdd.Rows[0]; DrAdd["Ask_ID"] = entity.Ask_ID; DrAdd["Ask_Type"] = entity.Ask_Type; DrAdd["Ask_Contact"] = entity.Ask_Contact; DrAdd["Ask_Content"] = entity.Ask_Content; DrAdd["Ask_Reply"] = entity.Ask_Reply; DrAdd["Ask_Addtime"] = entity.Ask_Addtime; DrAdd["Ask_SupplierID"] = entity.Ask_SupplierID; DrAdd["Ask_MemberID"] = entity.Ask_MemberID; DrAdd["Ask_ProductID"] = entity.Ask_ProductID; DrAdd["Ask_Pleasurenum"] = entity.Ask_Pleasurenum; DrAdd["Ask_Displeasure"] = entity.Ask_Displeasure; DrAdd["Ask_IsCheck"] = entity.Ask_IsCheck; DrAdd["Ask_Isreply"] = entity.Ask_Isreply; DrAdd["Ask_Site"] = entity.Ask_Site; DBHelper.SaveChanges(SqlAdd, DtAdd); } else { return(false); } } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } return(true); }
public virtual ShoppingAskInfo GetShoppingAskByID(int ID) { ShoppingAskInfo entity = null; SqlDataReader RdrList = null; try { string SqlList; SqlList = "SELECT * FROM Shopping_Ask WHERE Ask_ID = " + ID; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.Read()) { entity = new ShoppingAskInfo(); entity.Ask_ID = Tools.NullInt(RdrList["Ask_ID"]); entity.Ask_Type = Tools.NullInt(RdrList["Ask_Type"]); entity.Ask_Contact = Tools.NullStr(RdrList["Ask_Contact"]); entity.Ask_Content = Tools.NullStr(RdrList["Ask_Content"]); entity.Ask_Reply = Tools.NullStr(RdrList["Ask_Reply"]); entity.Ask_Addtime = Tools.NullDate(RdrList["Ask_Addtime"]); entity.Ask_SupplierID = Tools.NullInt(RdrList["Ask_SupplierID"]); entity.Ask_MemberID = Tools.NullInt(RdrList["Ask_MemberID"]); entity.Ask_ProductID = Tools.NullInt(RdrList["Ask_ProductID"]); entity.Ask_Pleasurenum = Tools.NullInt(RdrList["Ask_Pleasurenum"]); entity.Ask_Displeasure = Tools.NullInt(RdrList["Ask_Displeasure"]); entity.Ask_Isreply = Tools.NullInt(RdrList["Ask_Isreply"]); entity.Ask_IsCheck = Tools.NullInt(RdrList["Ask_IsCheck"]); entity.Ask_Site = Tools.NullStr(RdrList["Ask_Site"]); } return(entity); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool AddShoppingAsk(ShoppingAskInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT TOP 0 * FROM Shopping_Ask"; DtAdd = DBHelper.Query(SqlAdd); DrAdd = DtAdd.NewRow(); DrAdd["Ask_ID"] = entity.Ask_ID; DrAdd["Ask_Type"] = entity.Ask_Type; DrAdd["Ask_Contact"] = entity.Ask_Contact; DrAdd["Ask_Content"] = entity.Ask_Content; DrAdd["Ask_Reply"] = entity.Ask_Reply; DrAdd["Ask_Addtime"] = entity.Ask_Addtime; DrAdd["Ask_SupplierID"] = entity.Ask_SupplierID; DrAdd["Ask_MemberID"] = entity.Ask_MemberID; DrAdd["Ask_ProductID"] = entity.Ask_ProductID; DrAdd["Ask_Pleasurenum"] = entity.Ask_Pleasurenum; DrAdd["Ask_Displeasure"] = entity.Ask_Displeasure; DrAdd["Ask_IsCheck"] = entity.Ask_IsCheck; DrAdd["Ask_Isreply"] = entity.Ask_Isreply; DrAdd["Ask_Site"] = entity.Ask_Site; DtAdd.Rows.Add(DrAdd); try { DBHelper.SaveChanges(SqlAdd, DtAdd); return(true); } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } }