Exemplo n.º 1
0
        public IActionResult Index(WorkFlowModel model)
        {
            if (!model.LoadData)
            {
                return(DynamicResult(model));
            }
            FilterContainer <WorkFlow> filter = FilterContainerBuilder.Build <WorkFlow>();

            if (model.Name.IsNotEmpty())
            {
                filter.And(n => n.Name.Like(model.Name));
            }

            if (model.GetAll)
            {
                model.Page     = 1;
                model.PageSize = WebContext.PlatformSettings.MaxFetchRecords;
            }
            else if (!model.PageSizeBySeted && CurrentUser.UserSettings.PagingLimit > 0)
            {
                model.PageSize = CurrentUser.UserSettings.PagingLimit;
            }
            model.PageSize = model.PageSize > WebContext.PlatformSettings.MaxFetchRecords ? WebContext.PlatformSettings.MaxFetchRecords : model.PageSize;
            PagedList <WorkFlow> result = _workFlowFinder.QueryPaged(x => x
                                                                     .Page(model.Page, model.PageSize)
                                                                     .Where(filter)
                                                                     .Sort(n => n.OnFile(model.SortBy).ByDirection(model.SortDirection))
                                                                     , SolutionId.Value, true);

            model.Items      = result.Items;
            model.TotalItems = result.TotalItems;
            model.SolutionId = SolutionId.Value;
            return(DynamicResult(model));
        }
Exemplo n.º 2
0
 public ActionResult Edit(WorkFlowModel workFlowModel)
 {
     if (ModelState.IsValid)
     {
         var workFlow = AutoMapper.Mapper.Map <WorkFlow>(workFlowModel);
         db.Entry(workFlow).State = EntityState.Modified;
         workFlow.UserName        = Convert.ToString(Session["Username"]);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerID = new SelectList(db.Customer, "CustomerId", "CustomerName", workFlowModel.CustomerID);
     return(View(workFlowModel));
 }
Exemplo n.º 3
0
        public MainViewModel()
        {
            WorkFlowModel = new WorkFlowModel();
            WorkFlowModel.WorkArea.AddChildWorkFlowEventHandler += WorkArea_AddChildWorkFlowEventHandler;

            //BaseWorkFlow wf = new ProcessWorkFlow()
            //{
            //    Height = 80,
            //    Left=40,
            //    Top=30,
            //    Width = 80
            //};
            //wf.DataContext = wf;
            //WorkArea.WorkAreaItems.Add(wf);
        }
Exemplo n.º 4
0
 private void WorkArea_AddChildWorkFlowEventHandler(WorkFlowModel obj)
 {
     Messenger.Default.Send <object>(obj, MessageToken.ChildWindowMessageToken);
 }