Ejemplo n.º 1
0
        public IActionResult Create()
        {
            var form  = FormHorizontal.Create(new Models.TableEditModel(), Url.Location <Models.TableEditModel>(CreateResult));
            var panel = new Panel();

            panel.ConfigLocation();
            panel.Append(form);
            return(new HtmlResult(panel));
        }
Ejemplo n.º 2
0
        public ActionResult MoreLevel()
        {
            var model = LevelModel;
            var form  = FormHorizontal.Define(model, Url.Location(new Func <Models.MoreLevelModel, JsonResult>(MoreLevelResult))).Create();
            var panel = new Panel();

            panel.Append(form);
            panel.ConfigLocation();
            return(new HtmlResult(panel.CreateGrid()));
        }
        public ActionResult Create()
        {
            var form = FormHorizontal.Create(new Models.AppClientCreateModel(), Url.Location(new Func <Models.AppClientCreateModel, JsonResult>(CreateResult)));

            var panel = new Panel();

            panel.ConfigLocation();
            panel.Append(form);
            return(new HtmlResult(panel.CreateGrid()));
        }
Ejemplo n.º 4
0
        public ActionResult Index()
        {
            var model = new StepIndexModel();

            var panel = new Panel();

            panel.ConfigLocation();
            var form = FormHorizontal.Create(model, Url.Location(new Func <StepIndexModel, ActionResult>(Next)));

            panel.Append(form);

            return(new HtmlResult(panel.CreateGrid()));
        }
Ejemplo n.º 5
0
        public ActionResult Details(int id)
        {
            var model = GetDataSource().FirstOrDefault(o => o.Id == id);

            var panel = new Panel();

            panel.ConfigLocation();
            var form = FormHorizontal.Create(model, GetListSource());

            panel.Append(form);

            return(new HtmlResult(panel));
        }
Ejemplo n.º 6
0
        public ActionResult Next(StepIndexModel model)
        {
            var nextModel = new StepNextModel();

            nextModel.Name = model.Name;

            var panel = new Panel();

            panel.ConfigLocation();
            var form = FormHorizontal.Create(nextModel, Url.Location(new Func <StepNextModel, ActionResult>(Finish)));

            panel.Append(form);

            return(new HtmlResult(panel.CreateGrid()));
        }
Ejemplo n.º 7
0
        public ActionResult Edit(int id)
        {
            var model = GetDataSource().FirstOrDefault(o => o.Id == id);
            var panel = new Panel
            {
                Description = "hello, world"
            };

            panel.ConfigLocation();
            var form = FormHorizontal.Define(model, Url.Location(new Func <Models.DataTableItemModel, JsonResult>(EditResult)), GetListSource());

            panel.Append(form.Create());

            return(new HtmlResult(panel.CreateGrid()));
        }
Ejemplo n.º 8
0
        public ActionResult Finish(StepNextModel model)
        {
            var finishModel = new StepFinishModel();

            finishModel.Name    = Request.Form["Name"];
            finishModel.Content = model.Content;

            var panel = new Panel();

            panel.ConfigLocation();
            var form = FormHorizontal.Create(finishModel);

            panel.Append(form);

            return(new HtmlResult(panel.CreateGrid()));
        }
Ejemplo n.º 9
0
        public ActionResult Create()
        {
            var model = new Models.DataTableItemModel
            {
                CreateTime = DateTime.UtcNow
            };

            var panel = new Panel();

            panel.ConfigLocation();
            var form = FormHorizontal.Create(model, Url.Location(new Func <Models.DataTableItemModel, JsonResult>(Create)), GetListSource());

            panel.Append(form);

            return(new HtmlResult(panel));
        }
        public ActionResult Edit(Guid selectedId)
        {
            var data = new Application.AppClient().Get(selectedId);

            if (data == null)
            {
                return(HttpNotFound());
            }
            var form = FormHorizontal.Create(data.MapTo(new Models.AppClientEditModel()), Url.Location(new Func <Models.AppClientEditModel, JsonResult>(EditResult)));

            var panel = new Panel();

            panel.ConfigLocation();
            panel.Append(form);
            return(new HtmlResult(panel.CreateGrid()));
        }
Ejemplo n.º 11
0
        public ActionResult Edit(int parentId, int index)
        {
            var model  = GetDataSource(parentId).FirstOrDefault(o => o.Id == index);
            var source = new ListDataSource();

            source["Age"].Add(new ListDataItem("1", "1"));
            source["Age"].Add(new ListDataItem("2", "2"));

            var panel = new Panel();

            panel.ConfigLocation();
            var form = FormHorizontal.Create(model, Url.Location(new Func <int, Models.DataTableItemModel, JsonResult>(EditResult)).Set("parentId", parentId), source);

            panel.Append(form);

            return(new HtmlResult(panel.CreateGrid()));
        }
Ejemplo n.º 12
0
        public ActionResult Create(int parentId)
        {
            var model = new Models.DataTableItemModel();

            model.States = new List <Models.DataTableItemState>();
            model.States.Add(Models.DataTableItemState.Hight);
            model.CreateTime = DateTime.UtcNow;

            var source = new ListDataSource();

            source["Age"].Add(new ListDataItem("1", "1"));
            source["Age"].Add(new ListDataItem("2", "2"));

            var panel = new Panel();

            panel.ConfigLocation();
            var form = FormHorizontal.Create(model, Url.Location(new Func <int, Models.DataTableItemModel, JsonResult>(Create)).Set("parentId", parentId), source);

            panel.Append(form);

            return(new HtmlResult(panel));
        }
Ejemplo n.º 13
0
        public IActionResult Change(Guid selectedId)
        {
            var data = DataService.Instance.Get(selectedId);

            if (data == null)
            {
                return(new HtmlResult());
            }
            var model = new Models.TableEditModel()
            {
                Id   = data.Id,
                Name = data.Name,
                File = FileLocation.Create(data.Avatar.Name, data.Avatar.Type, string.Format("/File/Get/{0}", data.Id))
            };

            var form  = FormHorizontal.Create(model, Url.Location <Models.TableEditModel>(ChangeResult));
            var panel = new Panel();

            panel.ConfigLocation();
            panel.Append(form);
            return(new HtmlResult(panel));
        }
Ejemplo n.º 14
0
        public ActionResult Show(int id)
        {
            var data = GetDataSource().FirstOrDefault(o => o.Id == id);

            var model = data.MapTo(new Models.ShowModel());

            model.Id    = data.Id;
            model.Name  = data.Name;
            model.File  = FileLocation.Create("file.jpg", "image/jpg", "https://avatars.githubusercontent.com/u/1279501");
            model.Files = new List <HttpPostedFileBase>
            {
                FileLocation.Create("file1.jpg", "image/jpg", "https://avatars.githubusercontent.com/u/1279501"),
                FileLocation.Create("file2.jpg", "image/jpg", "https://avatars.githubusercontent.com/u/1279501")
            };
            var panel = new Panel();

            panel.ConfigLocation();
            var form = FormHorizontal.Create(model, Url.Location(new Func <Models.ShowModel, JsonResult>(ShowResult)), GetListSource());

            panel.Append(form);

            return(new HtmlResult(panel));
        }