Ejemplo n.º 1
0
        public bool CreateNewBrand(string Brand)
        {
            tbl_Brand obj = new tbl_Brand();

            obj.Brand = Brand;
            return(BrandName.CreateNewBrand(obj));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id,name")] tbl_Brand tbl_brand)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_brand).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_brand));
 }
Ejemplo n.º 3
0
        // GET: /Brand/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_Brand tbl_brand = db.tbl_Brand.Find(id);

            if (tbl_brand == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_brand));
        }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "id,name")] tbl_Brand tbl_brand)
        {
            if (ModelState.IsValid)
            {
                db.tbl_Brand.Add(tbl_brand);
                ViewBag.message = "Brand Inserted Succesfully";
                db.SaveChanges();

                ModelState.Clear();
                return(View());
            }

            return(View(tbl_brand));
        }
Ejemplo n.º 5
0
        public BrandViewModel AddBrand(BrandViewModel entity)
        {
            var data = new tbl_Brand()
            {
                BrandId    = entity.brandId,
                BrandName  = entity.brandName,
                IsActive   = entity.isActive,
                CreatedOn  = entity.createdOn,
                CreatedBy  = entity.createdBy,
                ModifiedOn = entity.modifiedOn,
                ModifiedBy = entity.modifiedBy
            };

            context.tbl_Brand.Add(data);
            context.SaveChanges();
            return(entity);
        }
Ejemplo n.º 6
0
        public JsonResult DeleteConfirmed(int id)
        {
            string success = string.Empty;
            // return Json(success, JsonRequestBehavior.AllowGet);

            tbl_Brand tbl_brand = db.tbl_Brand.Find(id);

            db.tbl_Brand.Remove(tbl_brand);
            int result = db.SaveChanges();

            if (result > 0)
            {
                success = "Data delete successfully";
            }
            //  return Json(success, JsonRequestBehavior.AllowGet);

            return(Json(new { result = success }));
        }
Ejemplo n.º 7
0
 public bool CreateNewBrand(tbl_Brand Brand)
 {
     create.tbl_Brand.AddObject(Brand);
     return(create.SaveChanges() > 0);
 }