Beispiel #1
0
        public async Task <IActionResult> PutPublisherList(int id, PublisherList publisherList)
        {
            if (id != publisherList.id)
            {
                return(BadRequest());
            }

            _context.Entry(publisherList).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PublisherListExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #2
0
        private void DV_Form_Load(object sender, EventArgs e)
        {
            titles  = TitleManager.ShowData();
            titleBS = new BindingSource(titles, "");

            publishers                = PublisherManager.ShowPublisherData();
            publisherBS               = new BindingSource(publishers, "");
            pubComboBox.DataSource    = publisherBS;
            pubComboBox.DisplayMember = "pub_name";
            pubComboBox.ValueMember   = "pub_id";

            titleID.DataBindings.Add("Text", titleBS, "title_id", true);
            title.DataBindings.Add("Text", titleBS, "title", true);
            type.DataBindings.Add("Text", titleBS, "type", true);
            pubComboBox.DataBindings.Add("SelectedValue", titleBS, "pub_id", true);
            price.DataBindings.Add("Text", titleBS, "price", true);
            advance.DataBindings.Add("Text", titleBS, "advance", true);
            royal.DataBindings.Add("Value", titleBS, "royalty", true);
            sales.DataBindings.Add("Value", titleBS, "ytd_sales", true);
            notes.DataBindings.Add("Text", titleBS, "notes", true);
            date.DataBindings.Add("Value", titleBS, "pubdate", true);

            BindNav = new BindingNavigator(true);
            this.Controls.Add(BindNav);
            BindNav.Dock          = DockStyle.Top;
            BindNav.BindingSource = titleBS;
        }
Beispiel #3
0
        public async Task <ActionResult <PublisherList> > PostPublisherList(PublisherList publisherList)
        {
            _context.PublisherList.Add(publisherList);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPublisherList", new { id = publisherList.id }, publisherList));
        }
        internal override PublisherList GetPublishers()
        {
            PublisherList list = new PublisherList();

            list.Add(new SqlExceptionPublisher());
            return(list);
        }
 private Task PublisherEvent(PublisherEventApiModel ev)
 {
     PublisherList.Results.Update(ev);
     _pagedPublisherList = PublisherList.GetPaged(int.Parse(Page), CommonHelper.PageLengthSmall, PublisherList.Error);
     StateHasChanged();
     return(Task.CompletedTask);
 }
Beispiel #6
0
 public override PublisherList GetPublisherList()
 {
     PublisherList list = new PublisherList();
     SqlPublisher sql = new SqlPublisher();
     list.Add(sql);
     return list;
 }
        public static void Handle(Exception e)
        {
            ExceptionHandlerFactory factory = ExceptionHandlerFactories.GetFactory(e);
            PublisherList           list    = factory.GetPublishers();
            ExceptionRule           rule    = factory.GetRule();

            rule.Run(e, list);
        }
Beispiel #8
0
        public static void Handle(IException e)
        {
            ExceptionFactory factory    = ExceptionFactories.GetExceptionFactory(e);
            PublisherList    publishers = factory.CreatePublishers();
            IAction          action     = factory.CreateAction();

            action.Run(e, publishers);
        }
Beispiel #9
0
        public override ExceptionRule GetExceptionRule()
        {
            var p = new PublisherList {
                new TextPublisher(), new SQLPublisher()
            };

            return(new ExceptionRule(p, new ContinueIfFailStrategy()));
        }
Beispiel #10
0
        internal override PublisherList CreatePublishers()
        {
            PublisherList publishers = new PublisherList();

            publishers.AddPublisher(new SqlPublisher());
            publishers.AddPublisher(new EventPublisher());

            return(publishers);
        }
Beispiel #11
0
        internal override PublisherList GetPublishers()
        {
            //config den
            // db okudu

            PublisherList list = new PublisherList();

            list.Add(new SqlExceptionPublisher());
            list.Add(new MailExceptionPublisher());
            list.Add(new EVExceptionPublisher());
            return(list);
        }
Beispiel #12
0
        public override PublisherList GetPublisherList()
        {
            PublisherList list = new PublisherList();
            SqlPublisher sql = new SqlPublisher();
            TextPublisher text = new TextPublisher();
            EmailPublisher email = new EmailPublisher();
            list.Add(sql);
            list.Add(text);
            list.Add(email);

            return list;
        }
 public override void Execute(Exception e, PublisherList publisherList)
 {
     foreach (var publisherItem in publisherList)
     {
         try
         {
             publisherItem.Publish(e);
         }
         catch
         {
         }
     }
 }
Beispiel #14
0
 internal override void Run(Exception e, PublisherList list)
 {
     foreach (ExceptionPublisher publisher in list)
     {
         try
         {
             publisher.Publish(e);
         }
         catch
         {
         }
     }
 }
Beispiel #15
0
 public void Cancel()
 {
     Book.TENSACH = dataProvider.GetItem <SACH>(x => x.MASACH == Book.MASACH).TENSACH;
     Book.NAMXB   = dataProvider.GetItem <SACH>(x => x.MASACH == Book.MASACH).NAMXB;
     Book.ANHBIA  = dataProvider.GetItem <SACH>(x => x.MASACH == Book.MASACH).ANHBIA;
     Author       = AuthorList.FirstOrDefault(x => x.MATG == Book.MATG);
     Category     = CategoryList.FirstOrDefault(x => x.MATL == Book.MATL);
     Publisher    = PublisherList.FirstOrDefault(x => x.MANXB == Book.MANXB);
     if (string.IsNullOrEmpty(Book.ANHBIA) == true || File.Exists(Book.ANHBIA) == false)
     {
         Book.ANHBIA = @"/Resources/Images/Book/DefaultBook.jpg";
     }
 }
Beispiel #16
0
        public static PublisherList ShowPublisherData()
        {
            PublisherList result = new PublisherList();

            try
            {
                return
                    (covnertDataTableToList(dBManager.executeDataTableQuiry("ShowPublisherData")));
            }
            catch
            {
            }
            return(result);
        }
Beispiel #17
0
        internal static PublisherList covnertDataTableToList(DataTable dataTable)
        {
            PublisherList publishers = new PublisherList();

            try
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    publishers.Add(covnertDataRowToPublisher(dataRow));
                }
            }
            catch { }
            return(publishers);
        }
Beispiel #18
0
        public override void Action(PublisherList publishers, Exception exp)
        {
            foreach (PublisherBase publisher in publishers)
            {
                try
                {
                    publisher.Publish(exp);
                }
                catch
                {

                }
            }
        }
        /// <summary>
        /// OnAfterRenderAsync
        /// </summary>
        /// <param name="firstRender"></param>
        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            if (firstRender)
            {
                PublisherList = await RegistryHelper.GetPublisherListAsync();

                Page = "1";
                _pagedPublisherList  = PublisherList.GetPaged(int.Parse(Page), CommonHelper.PageLengthSmall, PublisherList.Error);
                CommonHelper.Spinner = string.Empty;
                CommonHelper.CheckErrorOrEmpty(_pagedPublisherList, ref _tableView, ref _tableEmpty);
                StateHasChanged();

                _publisherEvent = await RegistryServiceEvents.SubscribePublisherEventsAsync(
                    ev => InvokeAsync(() => PublisherEvent(ev)));
            }
        }
Beispiel #20
0
 // Show Data
 private void GV_Form_Load(object sender, EventArgs e)
 {
     titles                          = TitleManager.ShowData();
     titlesBS                        = new BindingSource(titles, "");
     dgvTitle.DataSource             = titlesBS;
     publishers                      = PublisherManager.ShowPublisherData();
     publisherBS                     = new BindingSource(publishers, "");
     dgvComboBoxCol                  = new DataGridViewComboBoxColumn();
     dgvComboBoxCol.DataSource       = publisherBS;
     dgvComboBoxCol.HeaderText       = "Publisher";
     dgvComboBoxCol.DisplayMember    = "pub_name";
     dgvComboBoxCol.ValueMember      = "pub_id";
     dgvComboBoxCol.DataPropertyName = "pub_id";
     dgvTitle.Columns.Add(dgvComboBoxCol);
     dgvTitle.Columns["pub_id"].Visible = false;
     dgvTitle.Columns["State"].Visible  = false;
 }
Beispiel #21
0
 public BookDetailViewModel(DataProvider dataProvider, IEventAggregator eventAggregator) : base(dataProvider, eventAggregator)
 {
     AuthorList    = dataProvider.AuthorList;
     CategoryList  = dataProvider.CategoryList;
     PublisherList = dataProvider.PublisherList;
     Book          = dataProvider.SelectedBook;
     PublishRange  = dataProvider.LibraryRules.KHOANGCACHXB ?? 0;
     eventAggregator.Subscribe(this);
     Author     = AuthorList.FirstOrDefault(x => x.MATG == Book.MATG);
     Category   = CategoryList.FirstOrDefault(x => x.MATL == Book.MATL);
     Publisher  = PublisherList.FirstOrDefault(x => x.MANXB == Book.MANXB);
     DetailList = dataProvider.GetBookDetailList(x => x.MASACH == Book.MASACH);
     if (string.IsNullOrEmpty(Book.ANHBIA) == true || File.Exists(Book.ANHBIA) == false)
     {
         Book.ANHBIA = @"/Resources/Images/Book/DefaultBook.jpg";
     }
 }
Beispiel #22
0
 internal abstract void Run(Exception e, PublisherList list);
 internal override void Run(Exception e, PublisherList list)
 {
     foreach (ExceptionPublisher publisher in list)
     {
     }
 }
        internal override PublisherList GetPublishers()
        {
            PublisherList list = new PublisherList();

            return(list);
        }
Beispiel #25
0
 public abstract void Action(PublisherList publishers, Exception exp);
Beispiel #26
0
 private void onPublisherAdd(Publisher publisher)
 {
     PublisherList.Add(publisher);
 }
Beispiel #27
0
 internal override void Run(Exception e, PublisherList list)
 {
     Console.WriteLine("he he");
 }
        static void Main(string[] args)
        {
            try
            {
                var api = new API("http://192.168.91.130:8081");

                #region Address Test
                Address     address   = api.getAddressById(1);
                AddressList addresses = api.getAddresses();
                addresses = api.getAddresses(_page: 10, _per_page: 50);
                addresses = api.getAddresses(_page: 10);
                addresses = api.getAddresses(_per_page: 50);
                AddressList addresses2 = api.postAddresses(new AddressQueryCondition()
                {
                    postCodeLike = "134-%",
                    faxLike      = "0%"
                });
                Address address2 = new Address()
                {
                    addressId  = null,
                    postcode   = "123-4567",
                    prefecture = Prefecture.Tokyo,
                    address    = "船堀1-2-3-404",
                    building   = "コナミ船堀",
                    tel        = "090-9876-5432",
                    fax        = "03-1234-5678",
                    email      = "*****@*****.**",
                    createdAt  = DateTime.Now,
                    updatedAt  = DateTime.Now
                };
                address2.addressId = api.postAddress(address2);
                address2.email     = "*****@*****.**";
                api.putAddressById(address2.addressId.Value, address2);
                api.deleteAddressById(address2.addressId.Value);
                #endregion

                #region Author Test
                Author     author  = api.getAuthorById(1);
                AuthorList authors = api.getAuthors(_page: 10, _per_page: 50);
                authors = api.getAuthors();
                authors = api.getAuthors(_page: 10);
                authors = api.getAuthors(_per_page: 50);
                AuthorList authors2 = api.postAuthors(new AuthorQueryCondition()
                {
                    genderEq       = Gender.Female,
                    authorNameLike = "伊東",
                    prefectureIn   = new List <Prefecture>()
                    {
                        Prefecture.Tochigi, Prefecture.Saga
                    }
                });
                Author author2 = new Author()
                {
                    authorId  = null,
                    name      = "伊東 勝利",
                    age       = 45,
                    gender    = Gender.Male,
                    birth     = new DateTime(1970, 11, 6),
                    address   = address2,
                    createdAt = DateTime.Now,
                    updatedAt = DateTime.Now
                };
                author2.authorId = api.postAuthor(author2);
                author2.name     = "伊東 奈緒";
                author2.birth    = new DateTime(2012, 11, 2);
                author2.age      = 3;
                api.putAuthorById(author2.authorId.Value, author2);
                api.deleteAuthorById(author2.authorId.Value);
                #endregion

                #region Publisher Test
                Publisher     publissher = api.getPublisherById(1);
                PublisherList publishers = api.getPublishers();
                publishers = api.getPublishers(_page: 10, _per_page: 50);
                publishers = api.getPublishers(_page: 10);
                publishers = api.getPublishers(_per_page: 50);
                PublisherList publishers2 = api.postPublishers(new PublisherQueryCondition()
                {
                    companyTypeIn = new List <CompanyType>()
                    {
                        CompanyType.CO, CompanyType.LLC, CompanyType.INC
                    },
                    prefectureIn = new List <Prefecture>()
                    {
                        Prefecture.Tochigi, Prefecture.Hokkaido
                    }
                });
                Publisher publisher2 = new Publisher()
                {
                    publisherId = null,
                    name        = "オーム社",
                    companyType = CompanyType.CO,
                    address     = address2,
                    createdAt   = DateTime.Now,
                    updatedAt   = DateTime.Now
                };
                publisher2.publisherId = api.postPublisher(publisher2);
                publisher2.name        = "オライリー";
                publisher2.companyType = CompanyType.INC;
                publisher2.address     = address;
                api.putPublisherById(publisher2.publisherId.Value, publisher2);
                api.deletePublisherById(publisher2.publisherId.Value);
                #endregion

                #region Book Test
                Book     book  = api.getBookById(1);
                BookList books = api.getBooks();
                books = api.getBooks(_page: 10, _per_page: 50);
                books = api.getBooks(_page: 10);
                books = api.getBooks(_per_page: 50);
                BookList books2 = api.postBooks(new BookQueryCondition()
                {
                    categoryIn = new List <Category>()
                    {
                        Category.Science,
                        Category.Comics
                    },
                    publishedFrom = new DateTime(2010, 1, 1),
                    publishedTo   = new DateTime(2016, 12, 31)
                });
                Book book2 = new Book()
                {
                    bookId      = null,
                    title       = "Real World Haskell",
                    description = "For Haskellers",
                    category    = Category.Computer,
                    isbn        = "ISBN123-4567-890-123",
                    authors     = new List <AuthorInfo>()
                    {
                        new AuthorInfo()
                        {
                            authorId = 1,
                            name     = "伊東 勝利"
                        },
                        new AuthorInfo()
                        {
                            authorId = 1,
                            name     = "山下 伸夫"
                        }
                    },
                    publishedBy = new PublisherInfo()
                    {
                        publisherId = 3,
                        name        = "オーム社"
                    },
                    publishedAt = new DateTime(2000, 1, 1),
                    createdAt   = DateTime.Now,
                    updatedAt   = DateTime.Now
                };
                book2.bookId = api.postBook(book2);
                book2.title  = book2.title + " Ver.2";
                api.putBookById(book2.bookId.Value, book2);
                api.deleteBookById(book2.bookId.Value);

                book = api.getBookIsbnByIsbn("ISBN123-4567-8901-123");
                api.putBookIsbnByIsbn(book2.isbn, book2);
                api.deleteBookIsbnByIsbn(book2.isbn);

                #endregion
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }
 public ExceptionRule(PublisherList publisherList, StrategyBase strategyBase)
 {
     _publisherList = publisherList;
     _strategyBase  = strategyBase;
 }
 public abstract void Execute(Exception e, PublisherList publisherList);