protected void BindExchangeList() { GiftExchange bllGiftExchange = new GiftExchange(); int Counts = this.NetPagerParameter.RecordCount; string strSql = " GiftExchange.MemID=Mem.MemID and ExchangeStatus=1 "; if (this._UserShopID != 1) { strSql = PubFunction.GetShopAuthority(this._UserShopID, "ShopID", strSql); } DataTable dtGiftExchange = bllGiftExchange.GetVerifyListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[] { strSql }).Tables[0]; this.NetPagerParameter.RecordCount = Counts; this.NetPagerParameter.CustomInfoHTML = string.Format("<div class=\"results\"><span>当前第{0}/{1}页 共{2}条记录 每页{3}条</span></div>", new object[] { this.NetPagerParameter.CurrentPageIndex, this.NetPagerParameter.PageCount, this.NetPagerParameter.RecordCount, this.NetPagerParameter.PageSize }); this.rptExchangeVerify.DataSource = dtGiftExchange; this.rptExchangeVerify.DataBind(); PageBase.BindSerialRepeater(this.rptExchangeVerify, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1)); }
protected string QueryCondition() { string strQueryMem = this.txtQueryMem.Value; string strMemLevelID = this.sltMemLevelID.Value; string strMemShopID = this.sltShop.Value; string strGift = this.txtGift.Value; StringBuilder strSql = new StringBuilder(); strSql.Append(" 1=1 "); if (strQueryMem != "") { strSql.AppendFormat("and (MemCard = '{0}' or Mem.MemName like '%{0}%' or MemMobile = '{0}' or MemCardNumber = '{0}' )", strQueryMem); } if (strMemLevelID != "") { strSql.AppendFormat("and Mem.MemLevelID={0}", int.Parse(strMemLevelID)); } if (strMemShopID != "") { strSql.AppendFormat("and GiftExchange.ShopID={0}", int.Parse(strMemShopID)); } if (strGift != "") { DataTable dt = new GiftExchange().GetExchangeIDByGiftNameOrGiftCode(string.Format("(PointGift.GiftName like '%{0}%' or PointGift.GiftCode like '%{0}%')", strGift)); if (dt.Rows.Count > 0) { StringBuilder temp = new StringBuilder(); temp.Append("and ExchangeID in (" + dt.Rows[0][0]); for (int i = 1; i < dt.Rows.Count; i++) { temp.Append("," + dt.Rows[i][0]); } temp.Append(")"); strSql.Append(temp.ToString()); } else { strSql.Append("and ExchangeID in (-1)"); } } if (this.txtStartTime.Value != "") { strSql.AppendFormat("and ExchangeTime>='{0}' ", this.txtStartTime.Value); } if (this.txtEndTime.Value != "") { strSql.AppendFormat("and ExchangeTime<='{0}'", PubFunction.TimeEndDay(this.txtEndTime.Value)); } int intExchangeType = Convert.ToInt32(this.selectExchangeType.Value); if (intExchangeType != 0) { strSql.AppendFormat("and ExchangeType={0}", intExchangeType); } return(strSql.ToString()); }
public IActionResult Create([FromBody] GiftExchange item) { if (item == null) { return(BadRequest()); } _context.GiftExchanges.Add(item); _context.SaveChanges(); return(new ObjectResult(item)); }
private void BindExchage() { GiftExchange bllExchage = new GiftExchange(); string strSql = this.QueryCondition(); strSql += " and GiftExchange.MemID=Mem.MemID "; strSql = PubFunction.GetShopAuthority(this._UserShopID, "MemShopID", strSql); DataTable dtExchange = bllExchage.GetGiftExchange(strSql).Tables[0]; this.lblExchangeNumber.Text = dtExchange.Rows[0]["ExchangeAllNumber"].ToString(); this.lblExchangePoint.Text = dtExchange.Rows[0]["ExchangeAllPoint"].ToString(); }
public IActionResult Update(int id, [FromBody] GiftExchange item) { if (item == null) { return(BadRequest()); } var existing = _context.GiftExchanges.FirstOrDefault(g => g.ID == item.ID); if (existing == null) { return(NotFound()); } existing.UpdateFromObject(item); _context.SaveChanges(); return(new ObjectResult(existing)); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { GiftExchange bllExchange = new GiftExchange(); DataTable dt; if (base.Request.QueryString["type"] == "all") { dt = bllExchange.GetList(" 1=1 ").Tables[0]; } else { dt = bllExchange.GetList(10, " 1=1 ", "ApplicationTime").Tables[0]; } this.rptExchange.DataSource = dt; this.rptExchange.DataBind(); if (dt.Rows.Count < 10 || base.Request.QueryString["type"] == "all") { this.moreExchange.Attributes.Add("style", "display:none"); } } }
public void GetParameterList(string strSql) { GiftExchange bllGiftExchange = new GiftExchange(); int Counts = this.NetPagerParameter.RecordCount; strSql += " and GiftExchange.ExchangeStatus=2 and GiftExchange.MemID=Mem.MemID and GiftExchange.ExchangeUserID = SysUser.UserID and SysUser.UserShopID = SysShop.ShopID"; strSql = PubFunction.GetShopAuthority(this._UserShopID, "MemShopID", strSql); DataTable db = bllGiftExchange.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[] { strSql }).Tables[0]; this.NetPagerParameter.RecordCount = Counts; this.NetPagerParameter.CustomInfoHTML = string.Format("<div class=\"results\"><span>当前第{0}/{1}页 共{2}条记录 每页{3}条</span></div>", new object[] { this.NetPagerParameter.CurrentPageIndex, this.NetPagerParameter.PageCount, this.NetPagerParameter.RecordCount, this.NetPagerParameter.PageSize }); this.r_GiftExChange.DataSource = db; this.r_GiftExChange.DataBind(); PageBase.BindSerialRepeater(this.r_GiftExChange, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1)); }