Esempio n. 1
0
        public ActionResult GetDel(int ID)
        {
            int    rtn = GetPrize.DeleteByID(ID);
            string msg = rtn > 0 ? "ok" : "网络出错了!!";

            return(Content(msg));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public int DeleteGetPrize(int id)
        {
            GetPrize getPrize = db.GetPrize.Find(id);

            db.GetPrize.Remove(getPrize);
            int result = db.SaveChanges();

            return(result);
        }
Esempio n. 4
0
        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());
            }
        }
Esempio n. 6
0
        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));
        }
Esempio n. 7
0
 public int AddAllGetPrize(GetPrize getPrize)
 {
     return(dal.AddGetPrize(getPrize));
 }