Example #1
0
        public ActionResult Index(ReaderViewModel model)
        {
            model.CountryOptions     = defaultListItem;
            model.StateOptions       = defaultListItem;
            model.CityOptions        = defaultListItem;
            model.CategoryOptions    = defaultListItem;
            model.SubCategoryOptions = defaultListItem;

            EditorRepository repo = new EditorRepository();

            repo.AddAssistData(model);

            CategoryRepository catRepo    = new CategoryRepository();
            ReaderRepository   repoReader = new ReaderRepository();

            //CategoryRepository catRepo = new CategoryRepository();
            //ReaderViewModel models = new ReaderViewModel();
            model.CountryOptions     = repoReader.GetCountry();
            model.CategoryOptions    = catRepo.GetCategory();
            model.SubCategoryOptions = catRepo.GetSubCategory();

            model.save = true;
            model.information[0].Description = "";
            return(View(model));
        }
Example #2
0
        public ActionResult Delete(int id)
        {
            EditorRepository edrDel = new EditorRepository();

            edrDel.Remove(id);
            return(RedirectToAction("EditorList"));
        }
Example #3
0
        public ActionResult Index(ReaderViewModel model)
        {
            // Call service and insert records
            var repo = new EditorRepository();

            repo.CreateInfo(model);
            return(View(model));
        }
 public ArticleController()
 {
     article_repo = new ArticleRepository();
     col_repo     = new ColumnistRepository();
     cat_repo     = new CategoryRepository();
     edit_repo    = new EditorRepository();
     com_repo     = new CommentRepository();
 }
Example #5
0
        public ParameterSurface()
        {
            InitializeComponent();

            gridBinding.DataSource = _parameters;

            _repository = new EditorRepository(GetItemProperty);
        }
Example #6
0
        public ActionResult Add(Editor edtr, HttpPostedFileBase file)
        {
            EditorRepository editorAdd = new EditorRepository();

            edtr.CreateDate = DateTime.Now;
            edtr.ImageId    = AddNewsImage(file);
            editorAdd.Add(edtr);

            return(RedirectToAction("EditorList"));
        }
Example #7
0
        ///<summary>Applies any registered EditorSettings to an editor.</summary>
        ///<returns>True if there were any settings to apply.</returns>
        bool ApplySettings(BaseEdit edit)
        {
            //This will be called after normal designer serialization of previously applied settings

            if (edit.DataBindings.Count != 1)
            {
                if (ShouldShowErrors)
                {
                    Dialog.ShowError(edit.Name + " is not databound");
                }
                return(false);
            }
            var binding = edit.DataBindings[0];

            var column = GetColumn(binding);

            if (column == null)
            {
                if (ShouldShowErrors)
                {
                    Dialog.ShowError(edit.Name + " is not bound to a Singularity schema");
                }
                return(false);
            }

            var settings = EditorRepository.GetSettings(column);

            if (settings == null)
            {
                if (ShouldShowErrors)
                {
                    Dialog.ShowError("There are no settings associated with the " + column.Schema.Name + "." + column.Name + " column");
                }
                return(false);
            }
            if (!settings.ItemType.IsInstanceOfType(edit.Properties))
            {
                if (ShouldShowErrors)
                {
                    Dialog.ShowError("The " + edit.Name + " edit must be converted to a "
                                     + settings.ItemType.Name.Replace("RepositoryItem", "")
                                     + " in order to receive settings from " + column.Schema.Name + "." + column.Name);
                }
                return(false);
            }

            settings.Apply(edit.Properties);
            return(true);
        }
Example #8
0
        private BookCreate BuidBookCreate(Guid?categoryId = null, Guid?editorId = null, Guid?firmId = null)
        {
            var categories = new SelectList(CategoryRepository.GetAll(), "Id", "Title", categoryId);
            var allEditors = EditorRepository.GetAll();

            allEditors.Insert(0, null);
            var editors  = new SelectList(allEditors, "Id", "Title", editorId);
            var allFirms = FirmRepository.GetAll();

            allFirms.Insert(0, null);
            var firms      = new SelectList(allFirms, "Id", "Title", firmId);
            var bookCreate = new BookCreate
            {
                Categories = categories,
                Editors    = editors,
                Firms      = firms
            };

            return(bookCreate);
        }
Example #9
0
        static TriggerButton()
        {
            EditorRepository.Register(StagedPayment.AmountColumn, EditorRepository.CurrencyEditor);
            EditorRepository.Register(StagedPayment.AccountColumn, EditorRepository.AccountEditor);

            GridManager.RegisterColumn(StagedPayment.MethodColumn, MaxWidth(70));
            GridManager.RegisterColumn(StagedPayment.AccountColumn, MaxWidth(100));
            GridManager.RegisterColumn(StagedPayment.CommentsColumn, new CommentsColumnController());
            GridManager.RegisterColumn(
                StagedPayment.AmountColumn,
                new ColumnController(c => {
                c.DisplayFormat.FormatType   = FormatType.Numeric;
                c.DisplayFormat.FormatString = "c";

                c.MaxWidth = 85;
                c.SummaryItem.DisplayFormat = "{0:c} Total";
                c.SummaryItem.SummaryType   = SummaryItemType.Sum;
            })
                );

            GridManager.RegisterBehavior(StagedPayment.Schema,
                                         DeletionBehavior.WithMessages <StagedPayment>(
                                             singular: p => $"Are you sure you don't want to import this {p.Amount:c} payment?",
                                             plural: payments => $"Are you sure you want to don't want to import {payments.Count()} " +
                                             $"payments totaling {payments.Sum(p => p.Amount):c}?"
                                             )
                                         );

            GridManager.RegisterBehavior(StagedPerson.Schema,
                                         DeletionBehavior.WithMessages <StagedPerson>(
                                             singular: p => $"Are you sure you don't want to import {p.FullName}, with {p.StagedPayments.Count} payments?",
                                             plural: people => $"Are you sure you want to don't want to import {people.Count()} people with " +
                                             $"payments totaling {people.Sum(p => p.StagedPayments.Sum(pp => pp.Amount)):c}?"
                                             )
                                         );
        }
Example #10
0
 // GET: Editor
 public EditorController(EditorRepository rep)
 {
     _rep = rep;
 }
Example #11
0
 public ColumnistController()
 {
     col_repo    = new ColumnistRepository();
     app_repo    = new AppUserRepository();
     editor_repo = new EditorRepository();
 }
Example #12
0
 public EditorProfileController()
 {
     editor_repo = new EditorRepository();
 }
Example #13
0
 public HomeController()
 {
     App_repo       = new AppUserRepository();
     Editor_repo    = new EditorRepository();
     Columnist_repo = new ColumnistRepository();
 }
Example #14
0
 public EditorDomain(EditorRepository repository, EditorCommandHandler commandHandler)
 {
     Repository            = repository;
     CommandHandler        = commandHandler;
     CommandHandler.Domain = this;
 }
Example #15
0
 public AppUserController()
 {
     app_repo       = new AppUserRepository();
     editor_repo    = new EditorRepository();
     columnist_repo = new ColumnistRepository();
 }