public ActionResult Create() { var empty = new MyProductViewModel(); var data = empty.ToVM(); return(View(data)); }
public ActionResult Create(MyProductViewModel myProduct) { if (!ModelState.IsValid) { ErrorNotification("Kayıt Eklenemedi!"); return(RedirectToAction("Create")); } _myProductService.Add(new MyProduct { //TODO:Alanlar buraya yazılacak //Örn:BrandName = brand.BrandName, }); SuccessNotification("Kayıt Eklendi."); return(RedirectToAction("MyProductIndex")); }
public ActionResult Create(MyProductViewModel myProduct) { if (!ModelState.IsValid) { ErrorNotification("Kayıt Eklenemedi!"); return(RedirectToAction("Create")); } _myProductService.Add(new MyProduct { ProductName = myProduct.ProductName, MyProductImage = myProduct.MyProductImage, MyProductImageExt = ".png", Description = myProduct.Description, IsActive = myProduct.IsActive }); SuccessNotification("Kayıt Eklendi."); return(RedirectToAction("MyProductIndex")); }
public MyProductPage() { InitializeComponent(); BindingContext = viewModel = new MyProductViewModel(); viewModel.AllProductListView = productList; viewModel.OnExpiringListView = onExpiringProduct; viewModel.ExpiredListView = expiredProduct; viewModel.DeletedListView = deletedProduct; dialogService = new DialogService(); MessagingCenter.Unsubscribe <string>(this, Settings.MyProductFilterKey); MessagingCenter.Subscribe <string>(this, Settings.MyProductFilterKey, (args) => { LoadFilterData(); }); MessagingCenter.Unsubscribe <ProductDetailPage, ProductDetailViewModel>(this, Settings.MyProductReloadKey); MessagingCenter.Subscribe <ProductDetailPage, ProductDetailViewModel>(this, Settings.MyProductReloadKey, (sender, arg) => { ReloadEditProduct(arg); }); }