示例#1
0
        public ActionResult Update(int formId)
        {
            var model = new FormUpdateViewModel
            {
                form = _formService.GetById(formId),
            };

            return(View(model));
        }
示例#2
0
文件: Form.cs 项目: xhute/Kooboo
        public void UpdateForm(ApiCall call)
        {
            FormUpdateViewModel model = call.Context.Request.Model as FormUpdateViewModel;

            var form = call.WebSite.SiteDb().Forms.Get(model.Id);

            if (form != null)
            {
                form.Body = model.Body;


                form.FormSubmitter   = model.Submitter;
                form.Setting         = model.Settings;
                form.Method          = model.Method;
                form.AllowAjax       = model.AllowAjax;
                form.RedirectUrl     = model.RedirectUrl;
                form.IsEmbedded      = false; // once is updated.....
                form.SuccessCallBack = model.SuccessCallBack;
                form.FailedCallBack  = model.FailedCallBack;
                call.WebSite.SiteDb().Forms.AddOrUpdate(form, call.Context.User.Id);
            }
        }