public ActionResult GetDel(int ID) { int rtn = GetPrize.DeleteByID(ID); string msg = rtn > 0 ? "ok" : "网络出错了!!"; return(Content(msg)); }
public int AddGetPrize(GetPrize getPrize) { getPrize.Moneys = db.Prize.SingleOrDefault(p => p.ID == getPrize.PrizeID).PayDeductionDefault; db.GetPrize.Add(getPrize); int result = db.SaveChanges(); return(result); }
public int DeleteGetPrize(int id) { GetPrize getPrize = db.GetPrize.Find(id); db.GetPrize.Remove(getPrize); int result = db.SaveChanges(); return(result); }
public List <GetPrize> EditA3() { List <GetPrize> getPrize = db.GetPrize.ToList(); foreach (var item in getPrize) { GetPrize getPrize1 = db.GetPrize.Find(item.ID); db.GetPrize.Remove(getPrize1); db.SaveChanges(); } return(getPrize); }
public ActionResult Add(GetPrize getPrize) { int result = bll.AddAllGetPrize(getPrize); if (result != 0) { return(RedirectToAction("Index")); } else { Response.Write("出现错误"); return(View()); } }
public ActionResult GetAddPrize(GetPrize condition) { if (string.IsNullOrWhiteSpace(condition.Code)) { return(Content("防伪码不能为空!!")); } if (!Scale.GetAntiFake(condition.Code)) { return(Content("没有此防伪码!!")); } if (GetPrize.GetCodeRepeat(condition.Code) > 0) { return(Content("防伪码已设置奖品")); } Prize prize = Prize.GetEntitysAll().Single(m => m.Lever == condition.PrizeID); condition.PrizeName = prize.Name; condition.DatCreate = DateTime.Now; condition.State = "未抽到"; int rtn = condition.InsertAndReturnIdentity(); string msg = rtn > 0 ? "ok" : "网络出错了!!"; return(Content(msg)); }
public int AddAllGetPrize(GetPrize getPrize) { return(dal.AddGetPrize(getPrize)); }