public string vipscorepage() { int pageSize = 6;//每一页的行数 int pageNumber = 1;//当前页数 string html = ""; string skuid = ""; DateTime from, to; string where = ""; int mid = 0; if (!string.IsNullOrEmpty(RequestBase.GetString("pageNum"))) { pageNumber = Convert.ToInt32(RequestBase.GetString("pageNum")); } if (!string.IsNullOrEmpty(RequestBase.GetString("m_ID"))) { skuid = RequestBase.GetString("m_ID").ToString(); } if (!string.IsNullOrEmpty(RequestBase.GetString("from"))) { from = DateTime.Parse(RequestBase.GetString("from")); where += " and o_CreateOn >='" + from + "'"; } if (!string.IsNullOrEmpty(RequestBase.GetString("to"))) { to = DateTime.Parse(RequestBase.GetString("to")).AddDays(1); where += " and o_CreateOn <='" + to + "'"; } if (LoginMember != null) { mid = (CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies["UserInfo"].Value) as Model.MemberBase).m_ID; var list = new BLL.OrderBase().GetModelListbypric(" m_ID="+mid+ where +" and o_StatusCode=4 and o_IsDel=0 order by o_CreateOn desc"); ViewData["count"] = list.Count; ViewData["pagerows"] = pageSize; ViewData["page"] = pageNumber; var pagelist = list.ToPagedList(pageNumber, pageSize); List<Model.RejectionBase> lvlist = new BLL.RejectionBase().GetModelList(" m_ID=" + mid + " and r_Status=2"); html = "<tr><th>时间</th><th>积分</th><th>类型</th><th>来源订单</th></tr>"; foreach (var item in pagelist) { html += "<tr><td>" + item.o_CreateOn + "</td>"; if(lvlist.Where(o => o.o_ID == item.o_ID).Count()==1) { html += "<td>- "+item.o_Score+"</td><td>减少</td>"; } else { html += "<td>+ "+item.o_Score+"</td><td>增加</td>"; } html += "<td>" + item.o_Code + "</td></tr>"; } return html; } else { Response.Redirect("/Index/Index"); return ""; } }
public string shenqingtuidan() { string oid = ""; string rmark = ""; int mid = 0; string message = ""; if (LoginMember != null) { if (!string.IsNullOrEmpty(RequestBase.GetString("oid"))) { oid = RequestBase.GetString("oid").ToString(); } mid = (CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies["UserInfo"].Value) as Model.MemberBase).m_ID; List<Model.RejectionBase> rejmodel = new BLL.RejectionBase().GetModelList(" r_IsDelete =0 and m_ID=" + mid + " and o_ID=" + oid); Model.OrderBase oinfo = new BLL.OrderBase().GetModel(int.Parse(oid)); if (rejmodel.Count > 0&&oinfo.o_StatusCode!=4) { message = "already"; } else { message = "ok"; } } else { message = "nologon"; } return message; }
public ActionResult vipscore() { int pageSize = 6;//每一页的行数 int pageNumber = 1;//当前页数 DateTime from, to; string where = ""; int mid = 0; if (LoginMember != null) { mid = (CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies["UserInfo"].Value) as Model.MemberBase).m_ID; Model.MemberBase mmodel = new Model.MemberBase(); Model.OrderBase omodel = new Model.OrderBase(); int fen = 0; decimal fenj = 0; var list = new BLL.OrderBase().GetModelListbypric(" m_ID=" + mid + " and o_StatusCode=4 and o_IsDel=0 order by o_CreateOn desc"); foreach (var i in list) { fen += int.Parse(i.o_Score.ToString()); } var pagelist = list.ToPagedList(pageNumber, pageSize); var mlist = new BLL.MemberBase().GetModel(mid); ViewData["mScore"] = mlist.m_Score; ViewData["mid"] = mid; ViewData["count"] = list.Count; ViewData["pagerows"] = pageSize; ViewData["page"] = pageNumber; var jifen = new BLL.NewsBase().GetModelList(" n_Title='积分规则' and n_StatusCode=0 and n_IsDel=0"); ViewBag.jifen = jifen[0].n_Content; ViewBag.orderinfo = pagelist.ToList(); List<Model.RejectionBase> lvlist = new BLL.RejectionBase().GetModelList(" m_ID=" + mid + " and r_Status=2 and r_Isdelete=0"); foreach (var i in lvlist) { if ((i.r_Price.ToString()).IndexOf('.') > 0) { fenj += int.Parse((i.r_Price.ToString()).Substring(0, (i.r_Price.ToString()).IndexOf('.'))); } } if (fen - int.Parse(fenj.ToString()) > 0) { ViewData["jifenshu"] = fen - int.Parse(fenj.ToString()); } else { ViewData["jifenshu"] = 0; } return View(lvlist.ToList()); } else { Response.Redirect("/Index/Index"); return View(); } }
public string inserttui() { string code = ""; string rmark = ""; int mid = 0; string message = ""; if (LoginMember != null) { if (!string.IsNullOrEmpty(RequestBase.GetString("code"))) { code = RequestBase.GetString("code").ToString(); } if (!string.IsNullOrEmpty(RequestBase.GetString("rmark"))) { rmark = RequestBase.GetString("rmark").ToString(); ; } mid = (CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies["UserInfo"].Value) as Model.MemberBase).m_ID; //订单信息 var olist = obll.GetModelList(" o_IsDel=0 and o_Code='"+code+"'"); if (olist[0].o_StatusCode >= 1) { Model.RejectionBase reorder = new Model.RejectionBase(); reorder.m_ID = mid; reorder.o_ID = olist[0].o_ID; reorder.r_Code = code; reorder.r_Date = DateTime.Now; reorder.r_Price = (int)olist[0].o_Score; reorder.r_Status = 0; int result = new BLL.RejectionBase().Add(reorder); if (result > 0) { message = "OK"; } else { message = "fail"; } } else { message = "nopay"; } } else { message = "nologon"; } return message; }