Example #1
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);
 }
Example #2
0
        public ActionResult ggResultSet(int id,FormCollection f)
        {
            if (UserCommon.CheckBBSHighAdminRight(AdminType) == false)
                return RedirectToAction("ggAlert");

            bizGGuessUsers bgu = new bizGGuessUsers();
            bgu.ResultSet(id, int.Parse(f["item"]));
            return RedirectToAction("ggIndex");
        }
Example #3
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 });
        }
Example #4
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);
 }
Example #5
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);
        }