Esempio n. 1
0
        public ActionResult ExternalMethodDeleteRows(Guid[] checkedRecords)
        {
            checkedRecords = checkedRecords ?? new Guid[] { };

            try
            {
                MetaFormHelper.EMDelete(checkedRecords);
            }
            catch (NotValidationException ex)
            {
                return(Content(MessageHelper.FormedMessageNote(ex.Message), ""));
            }
            catch (Exception ex)
            {
                return(Content(MessageHelper.FormedMessageWarning(ex), ""));
            }

            return(Content(MessageHelper.FormedMessageSuccess(Resources.Resource.RowsDeleted + "!"), ""));
        }
Esempio n. 2
0
        public ActionResult Edit(Guid?id)
        {
            if (id.HasValue)
            {
                MetaForm obj = MetaFormHelper.Get(id.Value);
                if (obj == null)
                {
                    return(MessageHelper.FormedContentObjectNotFound());
                }

                MetaFormModel.CreateMap();
                MetaFormModel model = Mapper.Map <MetaForm, MetaFormModel>(obj);


                //SetShowImportExportOptions(model);
                model.ShowImportExportOptions = true;
                return(View(model));
            }
            else
            {
                return(View(new MetaFormModel()));
            }
        }
Esempio n. 3
0
        public ActionResult EditExternalMethod(Guid?id, Guid?FormId)
        {
            MetaFormExternalMethodModel model = null;

            if (id.HasValue)
            {
                var att = MetaFormHelper.GetExternalMethod(id.Value);
                if (att == null)
                {
                    return(MessageHelper.FormedContentObjectNotFound());
                }

                MetaFormExternalMethodModel.CreateMap();
                model = Mapper.Map <MetaFormExternalMethod, MetaFormExternalMethodModel>(att);
                return(View(model));
            }
            else if (FormId.HasValue)
            {
                MetaForm item = MetaFormHelper.Get(FormId.Value);
                if (item != null)
                {
                    return(View(new MetaFormExternalMethodModel
                    {
                        MetaFormId = item.Id,
                        MetaFormCaption = item.Caption,
                    }));
                }
                else
                {
                    return(MessageHelper.FormedContentObjectNotFound());
                }
            }
            else
            {
                return(MessageHelper.FormedContentObjectNotFound());
            }
        }
Esempio n. 4
0
 protected override void OnRestoreRows(Guid[] checkedRecords)
 {
     MetaFormHelper.Restore(checkedRecords);
 }
Esempio n. 5
0
 protected override void OnRemoveRows(Guid[] checkedRecords)
 {
     MetaFormHelper.Delete(checkedRecords, true);
 }