Ejemplo n.º 1
0
        public ActionResult ggaddItem(int id)
        {
            ViewData["CurrMenu"] = "�����";
            if (UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("ggAlert");

            bizGGuess bg = new bizGGuess();
            bizGGuessDe bgd = new bizGGuessDe();
            GGuess model = bg.Get(id);
            if (model.Status != 0)
                return RedirectToAction("ggChoice", new { id = id });

            List<GGuessDe> list = bgd.ListByGGuessID(id);
            ViewData["ID"] = id;
            ViewData["List"] = list;
            return View(model);
        }
Ejemplo n.º 2
0
        public void ResultSet(int id, int deid)
        {
            bizGGuess gm = new bizGGuess();
            bizGGuessDe gg = new bizGGuessDe();
            List<GGuessDe> list = gg.ListByGGuessID(id);
            GGuess modelMain = gm.Get(id);
            int allNum = list.Sum(p => p.JinbiNum);
            decimal peilv;
            GGuessDe model = list.First(p => p.GGuessDeID == deid);
            if (allNum == 0 || model.JinbiNum==0)
                peilv = 1;
            else
                peilv = Math.Round((decimal)allNum / model.JinbiNum, 2);

            Query query = new Query();
            query.AddParam("GGuessID", id);
            query.AddParam("GGuessDeID",deid);
            query.AddParam("Peilv", peilv);

            Gateway.Default.ExecuteSPForNonQuery("GGuessResultSet",query);

            //List<GGuessUsers> listGUser = ListByGGuessID(deid);
            //int i = 0;
            //foreach (GGuessUsers item in listGUser)
            //{
            //    i++;
            //    if (item.Status == 0)
            //    {
            //        Users modelUser = bu.Get(item.UserID);
            //        modelUser.Attach();
            //        modelUser.Jinbi = modelUser.Jinbi + int.Parse((decimal.Parse(item.Jinbi.ToString()) * peilv).ToString());
            //        modelUser.Detach();
            //        bu.Update(modelUser);
            //        item.Attach();
            //        item.Status = 1;
            //        item.Detach();
            //        Update(item);
            //    }
            //}
            //modelMain.Attach();
            //modelMain.ResultItem = model.ItemName;
            //modelMain.ResultUserNum = i;
            //modelMain.Status = 2;
            //modelMain.Detach();
            //gm.Update(modelMain);
        }
Ejemplo n.º 3
0
        public ActionResult ggadd(FormCollection f)
        {
            ViewData["CurrMenu"] = "�����";
            if (UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("ggAlert");

            bizGGuess bg = new bizGGuess();
            string strDate=f["year"] + "-" + f["month"] + "-" + f["day"] + " " + f["hour"] + ":" + f["minute"] + ":00";
            if (DateTime.Parse(strDate) < DateTime.Now)
            {
                TempData["Msg"] = "����ʱ��ֻ���ǽ�����ʱ��";
                return RedirectToAction("ggadd");
            }
            int gid = bg.Add(f["Title"], f["Remark"], DateTime.Parse(strDate));

            return Redirect("/game/ggaddItem/" + gid + ".html");
            //return RedirectToAction("ggaddItem", new { id = gid });
        }
Ejemplo n.º 4
0
        public ActionResult ggaddItem(int id, FormCollection f)
        {
            ViewData["CurrMenu"] = "�����";
            if (UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("ggAlert");

            bizGGuess bg = new bizGGuess();
            bizGGuessDe bgd = new bizGGuessDe();
            bgd.Add(id, f["ItemName"]);
            return RedirectToAction("ggaddItem", new { id = id });
        }
Ejemplo n.º 5
0
 public ActionResult ggUserDetail(int id)
 {
     ViewData["CurrMenu"] = "�����";
     bizGGuess bg = new bizGGuess();
     bizGGuessDe bgd=new bizGGuessDe();
     bizGGuessUsers bgu = new bizGGuessUsers();
     GGuessDe modelDe = bgd.Get(id);
     GGuess model = bg.Get(modelDe.GGuessID);
     ViewData["GGuesss"] = model;
     ViewData["GGuesssDe"] = modelDe;
     List<GGuessUsers> list = bgu.ListByGGuessID(id);
     return View(list);
 }
Ejemplo n.º 6
0
        public ActionResult ggSelf()
        {
            ViewData["CurrMenu"] = "�����";
            bizGGuess bg = new bizGGuess();
            List<GGuess> list = bg.ListByUserID(UserID, 50);

            return View(list);
        }
Ejemplo n.º 7
0
 public ActionResult ggResult(int id)
 {
     ViewData["CurrMenu"] = "�����";
     bizGGuess bg = new bizGGuess();
     bizGGuessDe bgd = new bizGGuessDe();
     bizGGuessUsers bgu = new bizGGuessUsers();
     GGuess model = bg.Get(id);
     List<GGuessDe> list = bgd.ListByGGuessID(id);
     List<GGuessUsers> listUser = bgu.List(id, UserID);
     int allNum = list.Sum(p => p.JinbiNum);
     for (int i = 0; i < list.Count; i++)
     {
         if (list[i].JinbiNum == 0 || allNum == 0)
             list[i].Peilv = 1;
         else
             list[i].Peilv = Math.Round((decimal)allNum / list[i].JinbiNum, 2);
     }
     ViewData["List"] = list;
     ViewData["Count"] = list.Count;
     ViewData["ListUser"] = listUser;
     return View(model);
 }
Ejemplo n.º 8
0
        public ActionResult ggModMain(int id, FormCollection f)
        {
            ViewData["CurrMenu"] = "�����";
            if (UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("ggAlert");

            bizGGuess bg = new bizGGuess();
            bizGGuessDe bgd = new bizGGuessDe();
            List<GGuessDe> list = bgd.ListByGGuessID(id);
            if (f["status"] != null && f["status"] == "1")
            {
                if (list == null | list.Count == 0)
                {
                    TempData["Msg"] = "�þ���û������޷�����";
                    return RedirectToAction("ggModMain", new { id = id });
                }
            }

            GGuess model = bg.Get(id);
            model.Attach();
            model.Title = MyText.SafeStr(f["Title"].Trim());
            model.Remark = MyText.SafeStr(f["Remark"].Trim());
            if (f["status"] != null)
                model.Status = byte.Parse(f["status"]);
            model.Detach();
            bg.Update(model);
            return RedirectToAction("ggaddItem", new { id = id });
        }
Ejemplo n.º 9
0
        public ActionResult ggModMain(int id)
        {
            ViewData["CurrMenu"] = "�����";
            if (UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("ggAlert");

            bizGGuess bg = new bizGGuess();
            GGuess model = bg.Get(id);

            return View(model);
        }
Ejemplo n.º 10
0
        public ActionResult ggIndex()
        {
            ViewData["CurrMenu"] = "�����";
            int count;
            int page = Request.QueryString["page"] == null ? 1 : int.Parse(Request.QueryString["page"].ToString());
            int pageSize=20;
            bizGGuess bg = new bizGGuess();

            List<GGuess> list = bg.List(UserCommon.CheckBBSHighAdminRight(AdminType), page - 1, pageSize, out count);
            ViewData["PageList"] = Page.GetPageList("/game/ggIndex.html", count, pageSize, page, false);
            ViewData["AdminType"] = AdminType;
            return View(list);
        }
Ejemplo n.º 11
0
        public ActionResult ggDelete(int id)
        {
            if (UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("ggAlert");

            bizGGuess bg = new bizGGuess();
            bg.DeleteAll(id);
            return RedirectToAction("ggindex");
        }
Ejemplo n.º 12
0
        public ActionResult ggChoice(int id, FormCollection f)
        {
            int userID = UserID;
            bizUsers bu = new bizUsers();
            bizGGuess bg = new bizGGuess();
            bizGGuessDe bgd = new bizGGuessDe();
            bizGGuessUsers bgu = new bizGGuessUsers();
            Users modelUser = bu.Get(userID);
            int allJinbi=0;
            GGuess model = bg.Get(id);
            List<GGuessDe> list = bgd.ListByGGuessID(id);

            int num = int.Parse(f["num"]);
            if (model.EndTime < DateTime.Now)
            {
                TempData["Msg"] = "�Ѿ����˾��½�ֹʱ�䣬�޷�Ͷע";
                return RedirectToAction("ggChoice", new { id = id });
            }
            for (int i = 1; i <= num; i++) {
                if (int.Parse(f["jinbi" + i]) < 0)
                {
                    TempData["Msg"] = "����Ҫ���";
                    return RedirectToAction("ggChoice", new { id = id });
                }
                allJinbi += int.Parse(f["jinbi" + i]);
            }
            if (allJinbi > modelUser.Jinbi)
            {
                TempData["Msg"] = "��İɱҲ���";
                return RedirectToAction("ggChoice", new { id = id });
            }
            for (int i = 1; i <= num; i++)
            {
                if (int.Parse(f["jinbi" + i])>0)
                    bgu.Add(list[i - 1].GGuessDeID, userID, UserName, int.Parse(f["jinbi" + i]));
            }

            return RedirectToAction("ggChoice", new { id = id });
        }
Ejemplo n.º 13
0
        public ActionResult ggChoice(int id)
        {
            ViewData["CurrMenu"] = "�����";
            int userID = UserID;
            bizGGuess bg = new bizGGuess();
            bizGGuessDe bgd = new bizGGuessDe();
            bizGGuessUsers bgu = new bizGGuessUsers();
            bizUsers bu = new bizUsers();
            if (bgu.isExist(id, userID))
            {
                return RedirectToAction("ggChoiced", new { id = id });
            }

            GGuess model = bg.Get(id);
            List<GGuessDe> list = bgd.ListByGGuessID(id);
            Users modelUser = bu.Get(userID);
            int allNum=list.Sum(p => p.JinbiNum);
            for (int i = 0; i < list.Count;i++ )
            {
                if (list[i].JinbiNum == 0 || allNum == 0)
                    list[i].Peilv = 1;
                else
                    list[i].Peilv = Math.Round((decimal)allNum / list[i].JinbiNum,2);
            }
            ViewData["List"] = list;
            ViewData["Count"] = list.Count;
            ViewData["Jinbi"] = modelUser.Jinbi;
            return View(model);
        }