Beispiel #1
0
        public void AddMasi(IzdeliqBindingModel model)
        {
            Masa masa = new Masa()
            {
                CatNumber    = model.CatNumber,
                Color        = model.Color,
                Description  = model.Description,
                Price        = model.Price,
                Name         = model.Name,
                Razmeri      = model.Razmeri,
                Type         = model.Type,
                NalichnostBr = model.NalichnostBr
            };
            Supplier supplier = this.Context.Suppliers.Find(model.SupplierId);

            masa.Supplier = supplier;
            if (model.ImageName != null && model.ImageName.ContentLength > 0)
            {
                using (var reader = new BinaryReader(model.ImageName.InputStream))
                {
                    masa.ImagePicture = reader.ReadBytes(model.ImageName.ContentLength);
                }
            }

            this.Context.Masi.Add(masa);
            this.Context.SaveChanges();
        }
Beispiel #2
0
 public ActionResult CreateSpalni(
     [Bind(Include = "CatNumber,Color,Description,Price,Name,Razmeri,Type,ImageName,NalichnostBr,SupplierId")] IzdeliqBindingModel model)
 {
     if (ModelState.IsValid)
     {
         this.service.AddSpalnq(model);
         return(this.RedirectToAction("Spalni"));
     }
     return(this.RedirectToAction("CreateSpalni"));
 }
        public void AddSpalnq(IzdeliqBindingModel model)
        {
            Spalnq spalnq = new Spalnq()
            {
                CatNumber    = model.CatNumber,
                Color        = model.Color,
                Description  = model.Description,
                Price        = model.Price,
                Name         = model.Name,
                Razmeri      = model.Razmeri,
                Type         = model.Type,
                NalichnostBr = model.NalichnostBr
            };

            this.Context.Spalni.Add(spalnq);
        }
 public void AddDetski(IzdeliqBindingModel model)
 {
     throw new NotImplementedException();
 }
 public void AddPortmanta(IzdeliqBindingModel model)
 {
     throw new NotImplementedException();
 }