예제 #1
0
        public static MvcHtmlString GetAllItemGroupList(this HtmlHelper htmlHelper, string name, int selectedValue)
        {
            List <ItemGroup> group = ExpRecordBLL.GetItemGroupList();

            string option      = "";
            string alloptgroup = "";

            for (int i = 0; i < group.Count; i++)
            {
                ItemGroup item = group[i];

                if (selectedValue == item.ItemID)
                {
                    option += " <option selected='selected' value = '" + item.ItemID + "' > " + item.ItemName + " </option >";
                }
                else
                {
                    option += " <option value = '" + item.ItemID + "' > " + item.ItemName + " </option >";
                }
            }
            alloptgroup += option;

            alloptgroup = "<select style = 'width: 100 %;' class='select2' id=" + name + " name=" + name + ">" +
                          "<option value='0'>&nbsp;&nbsp;&nbsp;所有物品</option>" +
                          alloptgroup +
                          "</select>";
            return(new MvcHtmlString(alloptgroup));
        }
예제 #2
0
        public ActionResult ExpRecord()
        {
            string               uid    = Session["memberID"].ToString();
            ExpRecordBLL         erBll  = new ExpRecordBLL();
            List <DAO.ExpRecord> exList = erBll.GetExpList(uid);

            return(View(exList));
        }
예제 #3
0
        public ActionResult MemberForSearchGameExp(Dictionary <string, string> queryvalues)
        {
            int    _id             = queryvalues.ContainsKey("UserID") ? string.IsNullOrWhiteSpace(queryvalues["UserID"]) ? 0 : Convert.ToInt32(queryvalues["UserID"]) : 0;
            int    _page           = queryvalues.ContainsKey("page") ? Convert.ToInt32(queryvalues["page"]) : 1;
            string _StartDate      = queryvalues.ContainsKey("StartDate") ? queryvalues["StartDate"] : DateTime.Now.ToString("yyyy-MM-dd 00:00:00");
            string _ExpirationDate = queryvalues.ContainsKey("ExpirationDate") ? queryvalues["ExpirationDate"] : DateTime.Now.AddDays(1).ToString("yyyy-MM-dd 00:00:00");
            string _SearchExt      = queryvalues.ContainsKey("SearchExt") ? queryvalues["SearchExt"] : "";

            int    MasterID    = User.Identity.GetUserId <int>();
            string _MasterList = AgentUserBLL.GetUserListString(MasterID);

            GameRecordView model = new GameRecordView {
                SearchExt = _SearchExt, StartDate = _StartDate, ExpirationDate = _ExpirationDate, Page = _page, UserList = _MasterList
            };

            if (Request.IsAjaxRequest())
            {
                return(PartialView("MemberForSearchGameExp_PageList", ExpRecordBLL.GetListByPageForAgent(model)));
            }
            model.DataList = ExpRecordBLL.GetListByPageForAgent(model);
            return(View(model));
        }
예제 #4
0
        public ActionResult AddOrder(string orderInfo)
        {
            Dictionary <string, object> mp = new Dictionary <string, object>();
            string UID = Session["memberID"].ToString();
            JavaScriptSerializer jss   = new JavaScriptSerializer();
            OrderInfo            oInfo = jss.Deserialize <OrderInfo>(orderInfo);

            if (oInfo != null && oInfo.shopList.Count > 0)
            {
                List <OrderModule.model.Shop> slist = new List <OrderModule.model.Shop>();
                foreach (var item in oInfo.shopList)
                {
                    OrderModule.model.Shop shop = new OrderModule.model.Shop();
                    shop.ID    = item.ID;
                    shop.Price = item.Price;
                    shop.Qty   = item.Qty;
                    shop.Attrs = item.Attrs;
                    shop.Type  = item.Type;
                    slist.Add(shop);
                    //购物车中活动产品的活动是否过期
                    if (item.Type != "-1")
                    {
                        string msg = "";
                        ActiveModule.ActiveBus abll = new ActiveModule.ActiveBus();
                        bool result = abll.ValiActivePro(int.Parse(item.Type), int.Parse(item.ID), item.Attrs, int.Parse(item.Qty), ref msg);
                        if (!result)
                        {
                            mp.Add("status", "error");
                            mp.Add("msg", msg);
                            return(Json(mp, JsonRequestBehavior.AllowGet));
                        }
                    }
                    //------
                }
                OrderBuss obll = new OrderBuss();
                //产品验证 活动产品=》活动是否过期
                //价格验证
                //增加积分1.自己 2.上级
                //给上级返利
                MemberBLL       mbmBll        = new MemberBLL();
                DAO.MemberBase  mb            = mbmBll.GetUserByID(UID);
                MemberLevelBLL  memLeveBll    = new MemberLevelBLL();
                DAO.MemberLevel memLevel      = memLeveBll.GetLeveByUid(UID);
                decimal         orderPrice    = decimal.Parse(oInfo.shopTotlePrice);
                decimal         shopListTotle = 0;
                bool            vr            = obll.OrderAmountCheck(slist, orderPrice, memLevel.Ratio, out shopListTotle);
                if (vr)
                {
                    if (ValidateSendInfo(oInfo.sendInfo))
                    {
                        OrderModule.model.SendInfo sendinfo = new OrderModule.model.SendInfo();
                        sendinfo.Address = oInfo.sendInfo.Address;
                        sendinfo.Area    = oInfo.sendInfo.Area;
                        sendinfo.City    = oInfo.sendInfo.City;
                        sendinfo.Name    = oInfo.sendInfo.Name;
                        sendinfo.Phone   = oInfo.sendInfo.Phone;
                        sendinfo.Prov    = oInfo.sendInfo.Prov;
                        //价格验证通过增加订单
                        string OrderNumber = obll.AddOrder(slist, sendinfo, UID, memLevel.Ratio, orderPrice, shopListTotle);

                        if (OrderNumber != null)
                        {
                            //订单增加成功
                            mp.Add("status", "ok");
                            mp.Add("order", OrderNumber);
                            //给当前用户增加积分,给上级增加积分,给上级返利
                            //反积分
                            ExpRecordBLL expBll = new ExpRecordBLL();
                            expBll.GiveExp(mb, orderPrice, OrderNumber);
                            //返利如果有上级
                            if (mb.UpUser != -1 && mb.UpUser != 0)
                            {
                                RebateRecordBLL rrBll = new RebateRecordBLL();
                                rrBll.GiveParentRebate(UID, mb.LoginName, mb.UpUser, OrderNumber, orderPrice);
                            }
                            return(Json(mp, JsonRequestBehavior.AllowGet));
                        }
                        else
                        {
                            //订单增加异常
                            mp.Add("status", "catch");
                            return(Json(mp, JsonRequestBehavior.AllowGet));
                        }
                    }
                    else
                    {
                        //价格验证失败
                        mp.Add("status", "error");
                        mp.Add("msg", "配送信息验证失败!");
                        return(Json(mp, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    //价格验证失败
                    mp.Add("status", "error");
                    mp.Add("msg", "价格验证失败!");
                    return(Json(mp, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                //价格验证失败
                mp.Add("status", "error");
                mp.Add("msg", "没有产品!");
                return(Json(mp, JsonRequestBehavior.AllowGet));
            }
        }