Esempio n. 1
0
        public ActionResult SubmitAdd(ItemModel item, HttpPostedFileBase imgFile)
        {
            if (imgFile != null)
            {
                var file = UploadFile(imgFile.InputStream, imgFile.FileName);
                item.ImageSrc = file.FullName.Substring(AppDomain.CurrentDomain.BaseDirectory.Length-1).Replace('\\','/');
            }

            DisplayModelsProvider.AddItem(item);

            Notify(ActionFactory.CreateSimpleAction("New Item!"));

            return RedirectToAction("Index");
        }
Esempio n. 2
0
 public void AddItem(ItemModel itemModel)
 {
     dataProvider.AddUnit(itemModel.ToDbModel());
 }