public ActionResult Show( string taskId ) { using( var model = new DemoshopModel() ) { ViewBag.TaskId = taskId; return View( model.FindTask( taskId ) ); } }
public ActionResult UpdateItem( [Bind( Include = "Sku, Title, Price, Quantity" )] DemoshopItem item ) { using( var model = new DemoshopModel() ) { model.UpdateItem( item ); model.Message = "Item updated"; } return RedirectToAction( "Index" ); }
// --------------------------------------------------------[] public ActionResult RunChannelTasks() { using( var model = new DemoshopModel() ) { Dispatcher.Instance.RunChannelTasks( model.ChannelTasksTodo ); model.Message = "Tasks started"; } return RedirectToAction( "Index" ); }
// --------------------------------------------------------[] public ActionResult RevertItem() { using( var model = new DemoshopModel() ) { model.SetItemToDefault(); model.Message = "Item reverted"; } return RedirectToAction( "Index" ); }
// --------------------------------------------------------[] public ActionResult ProceedChannelTasks() { using( var model = new DemoshopModel() ) { Dispatcher.Instance.ProceedChannelTasks( model.ChannelTasksInprocess ); model.Message = "Tasks proceeded"; } return RedirectToAction( "Index" ); }
// --------------------------------------------------------[] public ActionResult DeleteTasks() { using( var model = new DemoshopModel() ) { model.DeleteTasks(); model.Message = "Tasks deleted"; } return RedirectToAction( "Index" ); }
// --------------------------------------------------------[] public ActionResult AddTask() { using( var model = new DemoshopModel() ) { model.CreateEbaySubmissionTask(); model.Message = "Task added"; } return RedirectToAction( "Index" ); }
public void IndexTest() { var message = ""; using( var m = new DemoshopModel() ) { m.DeleteTasks(); m.CreateEbaySubmissionTask(); m.Message = ( message = "Task [{0}] added".SafeFormat( m.StoreTasks.First().Id ) ); } var model = new DemoshopModel(); Console.WriteLine( message ); Assert.AreEqual( 1, model.StoreTasks.Count(), "StoreTasks.Count" ); Assert.AreEqual( message, model.Message, "Message" ); ShowTasks( model.StoreTasks ); }