public ActionResult Create(ProductViewModel collection) { try { dtbs15Entities db = new dtbs15Entities(); Product bc = new Product(); bc.Add_Date = collection.Add_Date; bc.Browser_Id = collection.Browser_Id; bc.BcamId = collection.BcamId; bc.Price = collection.price; bc.Wifi = collection.WIFI; bc.USB_Id = collection.USB_Id; bc.Resolution = collection.Resolution; bc.CategoryId = collection.categoryID; bc.CardSupport = collection.card_support; bc.Connectivity_Id = collection.Connectivity_Id; bc.FcamId = collection.FcamId; db.Products.Add(bc); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: FrontCamera/Delete/5 public ActionResult Delete(int id) { dtbs15Entities db = new dtbs15Entities(); var fc = db.Front_Camera.Where(x => x.Id == id).SingleOrDefault(); var result = db.Front_Camera.Remove(fc); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Product/Delete/5 public ActionResult Delete(int id) { dtbs15Entities db = new dtbs15Entities(); var c = db.Products.Where(x => x.Id == id).First(); db.Products.Remove(c); return(RedirectToAction("Index")); }
// GET: Category/Delete/5 public ActionResult Delete(int id) { dtbs15Entities db = new dtbs15Entities(); var bc = db.Categories.Where(x => x.id == id).SingleOrDefault(); var result = db.Categories.Remove(bc); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Index() { dtbs15Entities db = new dtbs15Entities(); List <Category> h = db.Categories.ToList(); ViewBag.Hos = h; return(View()); }
public ActionResult Index1(int id) { dtbs15Entities db = new dtbs15Entities(); var product = from s in db.Products select s; product = product.Where(s => s.CategoryId == id); return(View(product.ToList())); }
public ActionResult ShowByOS() { dtbs15Entities db = new dtbs15Entities(); var c = (from b in db.By_OS select b).ToList(); ByOS rpt = new ByOS(); rpt.Load(); rpt.SetDataSource(c); Stream s = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); return(File(s, "application/pdf", "ByOS.pdf")); }
public ActionResult Create(DisplayViewModel collection) { try { dtbs15Entities db = new dtbs15Entities(); Display bc = new Display(); bc.Technology = collection.Technology; db.Displays.Add(bc); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here dtbs15Entities db = new dtbs15Entities(); var bc = db.Connectivities.Where(x => x.id == id).SingleOrDefault(); var result = db.Connectivities.Remove(bc); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, OSViewModel collection) { try { dtbs15Entities db = new dtbs15Entities(); OperatingSystem bc = new OperatingSystem(); var c = db.OperatingSystems.Where(x => x.Id == id).SingleOrDefault(); c.OS = collection.OS; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(int?id, BacKCameraVIewModel collection) { try { // TODO: Add delete logic here dtbs15Entities db = new dtbs15Entities(); var c = db.Back_Camera.Where(x => x.Id == id).First(); db.Back_Camera.Remove(c); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: USB public ActionResult Index() { dtbs15Entities db = new dtbs15Entities(); var ca = db.USBs.ToList(); List <USBViewModel> bc = new List <USBViewModel>(); foreach (var c in ca) { USBViewModel b = new USBViewModel(); b.id = c.id; b.Type = c.Type; bc.Add(b); } return(View(bc)); }
// GET: FrontCamera public ActionResult Index() { dtbs15Entities db = new dtbs15Entities(); var ca = db.Front_Camera.ToList(); List <FrontCameraViewModel> fc = new List <FrontCameraViewModel>(); foreach (var c in ca) { FrontCameraViewModel b = new FrontCameraViewModel(); b.id = c.Id; b.Pixel = c.Pixel; fc.Add(b); } return(View(fc)); }
public ActionResult Create(BacKCameraVIewModel collection) { try { // TODO: Add insert logic here dtbs15Entities db = new dtbs15Entities(); Back_Camera bc = new Back_Camera(); bc.Pixel = collection.Pixel; db.Back_Camera.Add(bc); db.SaveChanges(); return(RedirectToAction("~/Home/AdminPanel")); } catch { return(View()); } }
// GET: ROM public ActionResult Index() { dtbs15Entities db = new dtbs15Entities(); var ca = db.ROMs.ToList(); List <RomViewModel> bc = new List <RomViewModel>(); foreach (var c in ca) { RomViewModel b = new RomViewModel(); b.rid = c.id; b.Capacity = c.ROM1; bc.Add(b); } return(View(bc)); }
public ActionResult Create(OSViewModel collection) { try { dtbs15Entities db = new dtbs15Entities(); OperatingSystem bc = new OperatingSystem(); bc.OS = collection.OS; db.OperatingSystems.Add(bc); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Display/Details/5 public ActionResult Details(int id) { dtbs15Entities db = new dtbs15Entities(); var ca = db.Displays.ToList(); List <DisplayViewModel> bc = new List <DisplayViewModel>(); foreach (var c in ca) { DisplayViewModel b = new DisplayViewModel(); b.id = c.id; b.Technology = c.Technology; bc.Add(b); } return(View(bc)); }
// GET: OperatinSystem public ActionResult Index() { dtbs15Entities db = new dtbs15Entities(); var ca = db.OperatingSystems.ToList(); List <OSViewModel> bc = new List <OSViewModel>(); foreach (var c in ca) { OSViewModel b = new OSViewModel(); b.id = c.Id; b.OS = c.OS; bc.Add(b); } return(View(bc)); }
public ActionResult Edit(int id, DisplayViewModel collection) { try { // TODO: Add update logic here dtbs15Entities db = new dtbs15Entities(); Display bc = new Display(); var c = db.Displays.Where(x => x.id == id).SingleOrDefault(); c.Technology = collection.Technology; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(USBViewModel collection) { try { dtbs15Entities db = new dtbs15Entities(); USB bc = new USB(); bc.Type = collection.Type; db.USBs.Add(bc); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: BackCamera public ActionResult Index() { dtbs15Entities db = new dtbs15Entities(); var ca = db.Back_Camera.ToList(); List <BacKCameraVIewModel> bc = new List <BacKCameraVIewModel>(); foreach (var c in ca) { BacKCameraVIewModel b = new BacKCameraVIewModel(); b.bid = c.Id; b.Pixel = c.Pixel; bc.Add(b); } return(View(bc)); }
public ActionResult Create(RamViewModel collection) { try { // TODO: Add insert logic here dtbs15Entities db = new dtbs15Entities(); RAM bc = new RAM(); bc.Capacity = collection.Capacity; db.RAMs.Add(bc); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(FrontCameraViewModel Collection) { try { // TODO: Add insert logic here dtbs15Entities db = new dtbs15Entities(); Front_Camera fc = new Front_Camera(); fc.Pixel = Collection.Pixel; db.Front_Camera.Add(fc); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Connectivity public ActionResult Index() { dtbs15Entities db = new dtbs15Entities(); var con = db.Connectivities.ToList(); List <FrequencyViewModel> fc = new List <FrequencyViewModel>(); foreach (var c in con) { FrequencyViewModel f = new FrequencyViewModel(); f._2G_Band = c.C2G_Band; f._3G_Band = c.C3G_Band; f._4G_Band = c.C4G_Band; fc.Add(f); } return(View(fc)); }
public ActionResult Edit(int id, RamViewModel collection) { try { // TODO: Add update logic here dtbs15Entities db = new dtbs15Entities(); RAM bc = new RAM(); var c = db.RAMs.Where(x => x.Id == id).SingleOrDefault(); c.Capacity = collection.Capacity; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Category public ActionResult Index() { dtbs15Entities db = new dtbs15Entities(); var cat = db.Categories.ToList(); List <CategoryViewModel> fc = new List <CategoryViewModel>(); foreach (var c in cat) { CategoryViewModel ct = new CategoryViewModel(); ct.manufacturer = c.Manufacturer; ct.Add_Date = c.Add_Date; ct.Update_Date = Convert.ToDateTime(c.Update_Date); fc.Add(ct); } return(View(fc)); }
public ActionResult Edit(int id, BacKCameraVIewModel collection) { try { dtbs15Entities db = new dtbs15Entities(); Back_Camera bc = new Back_Camera(); var c = db.Back_Camera.Where(x => x.Id == id).SingleOrDefault(); c.Pixel = collection.Pixel; db.SaveChanges(); // TODO: Add update logic here return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create() { dtbs15Entities db = new dtbs15Entities(); List <Category> h = db.Categories.ToList(); ViewBag.Hos = h; List <Front_Camera> fc = db.Front_Camera.ToList(); ViewBag.cam = fc; List <Back_Camera> bc = db.Back_Camera.ToList(); ViewBag.bcam = bc; List <OperatingSystem> os = db.OperatingSystems.ToList(); ViewBag.ops = os; List <RAM> rm = db.RAMs.ToList(); ViewBag.rms = rm; List <Display> dp = db.Displays.ToList(); ViewBag.dis = dp; List <ROM> rom = db.ROMs.ToList(); ViewBag.roms = rom; List <Connectivity> con = db.Connectivities.ToList(); ViewBag.cnc = con; List <USB> usb = db.USBs.ToList(); ViewBag.usbs = usb; List <Browser> brs = db.Browsers.ToList(); ViewBag.brw = brs; List <Processor> prs = db.Processors.ToList(); ViewBag.pro = prs; return(View()); }
public ActionResult Create(CategoryViewModel collection) { try { dtbs15Entities db = new dtbs15Entities(); Category c = new Category(); c.Add_Date = DateTime.Now.Date; c.Manufacturer = collection.manufacturer; db.Categories.Add(c); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, FrequencyViewModel collection) { try { dtbs15Entities db = new dtbs15Entities(); Connectivity con = new Connectivity(); var c = db.Connectivities.Where(x => x.id == id).SingleOrDefault(); c.C2G_Band = collection._2G_Band; c.C3G_Band = collection._3G_Band; c.C4G_Band = collection._4G_Band; db.SaveChanges(); // TODO: Add update logic here return(RedirectToAction("Index")); } catch { return(View()); } }