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); }
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); }
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 }); }
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); }
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); }
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 }); }
public ActionResult ggmodItem(int id,FormCollection f) { if (UserCommon.CheckBBSHighAdminRight(AdminType) == false) return RedirectToAction("ggAlert"); bizGGuessDe bgd = new bizGGuessDe(); GGuessDe model = bgd.Get(id); model.Attach(); model.ItemName = MyText.SafeStr(f["ItemName"].Trim()); model.Detach(); bgd.Update(model); return RedirectToAction("ggaddItem", new { id = model.GGuessID }); }
public ActionResult ggmodItem(int id) { ViewData["CurrMenu"] = "�����"; if (UserCommon.CheckBBSHighAdminRight(AdminType) == false) return RedirectToAction("ggAlert"); bizGGuessDe bgd = new bizGGuessDe(); GGuessDe model = bgd.Get(id); return View(model); }
/// <summary> /// ɾ���н��������� /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult ggdelitem(int id) { if (UserCommon.CheckBBSHighAdminRight(AdminType) == false) return RedirectToAction("ggAlert"); bizGGuessDe bgd = new bizGGuessDe(); GGuessDe model = bgd.Get(id); int mainid = model.GGuessID; bgd.Delete(id); return RedirectToAction("ggaddItem", new { id = mainid }); }
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 }); }
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); }