コード例 #1
0
ファイル: TaskController.cs プロジェクト: six006/spreadbot
 public ActionResult Show( string taskId )
 {
     using( var model = new DemoshopModel() ) {
         ViewBag.TaskId = taskId;
         return View( model.FindTask( taskId ) );
     }
 }
コード例 #2
0
 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" );
 }
コード例 #3
0
 // --------------------------------------------------------[]
 public ActionResult RunChannelTasks()
 {
     using( var model = new DemoshopModel() ) {
         Dispatcher.Instance.RunChannelTasks( model.ChannelTasksTodo );
         model.Message = "Tasks started";
     }
     return RedirectToAction( "Index" );
 }
コード例 #4
0
 // --------------------------------------------------------[]
 public ActionResult RevertItem()
 {
     using( var model = new DemoshopModel() ) {
         model.SetItemToDefault();
         model.Message = "Item reverted";
     }
     return RedirectToAction( "Index" );
 }
コード例 #5
0
 // --------------------------------------------------------[]
 public ActionResult ProceedChannelTasks()
 {
     using( var model = new DemoshopModel() ) {
         Dispatcher.Instance.ProceedChannelTasks( model.ChannelTasksInprocess );
         model.Message = "Tasks proceeded";
     }
     return RedirectToAction( "Index" );
 }
コード例 #6
0
 // --------------------------------------------------------[]
 public ActionResult DeleteTasks()
 {
     using( var model = new DemoshopModel() ) {
         model.DeleteTasks();
         model.Message = "Tasks deleted";
     }
     return RedirectToAction( "Index" );
 }
コード例 #7
0
 // --------------------------------------------------------[]
 public ActionResult AddTask()
 {
     using( var model = new DemoshopModel() ) {
         model.CreateEbaySubmissionTask();
         model.Message = "Task added";
     }
     return RedirectToAction( "Index" );
 }
コード例 #8
0
        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 );
        }