Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            UserBundTable userBundTable = db.UserBundTables.Find(id);

            db.UserBundTables.Remove(userBundTable);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ID,I_UID,I_Type,I_BD_ID")] UserBundTable userBundTable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userBundTable).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userBundTable));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "ID,I_UID,I_Type,I_BD_ID")] UserBundTable userBundTable)
        {
            if (ModelState.IsValid)
            {
                db.UserBundTables.Add(userBundTable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(userBundTable));
        }
Exemplo n.º 4
0
 public int HasBund(UserBundTable bund)
 {
     try
     {
         return(db.UserBundTables.AsNoTracking().Where(x => x.I_Type == bund.I_Type && x.I_BD_ID == bund.I_BD_ID && x.I_UID == bund.I_UID).FirstOrDefault().ID);
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Exemplo n.º 5
0
        // GET: UserBundTables/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserBundTable userBundTable = db.UserBundTables.Find(id);

            if (userBundTable == null)
            {
                return(HttpNotFound());
            }
            return(View(userBundTable));
        }
Exemplo n.º 6
0
        public int HasBundType(UserBundTable bund)
        {
            try
            {
                int count = db.UserBundTables.AsNoTracking().Where(x => x.I_Type == bund.I_Type && x.I_UID == bund.I_UID).Count();
                if (count > 0)
                {
                    UserBundTable ut = db.UserBundTables.AsNoTracking().Where(x => x.I_Type == bund.I_Type && x.I_UID == bund.I_UID).Take(1).FirstOrDefault();

                    return(ut.ID);
                }
                else
                {
                    return(-1);
                }
            }

            catch (Exception)
            {
                throw;
            }
        }