Exemple #1
0
        private void UpdateNewsButton_Click(object sender, EventArgs e)
        {
            Thread T = new Thread(delegate()
            {
                SplashWindow.CreateCoverSplash(LightNewsContainer.Top, LightNewsContainer.Left,
                                               LightNewsContainer.Height, LightNewsContainer.Width);
            });

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }

            if (cbtnClients.Checked)
            {
                MarketingNews.FillNewClientsNews();

                NewClientsMenu.ClientsDataTable = MarketingNews.ClientsNewsDataTable;
                NewClientsMenu.InitializeItems();
                if (MarketingNews.ClientsNewsDataTable.Rows.Count == 0)
                {
                    ClientsMenu.Top    = 0;
                    ClientsMenu.Height = panel1.Height;

                    MarketingNews.FillNewManagersNews();

                    NewClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersNewsDataTable;
                    NewClientsManagersMenu.InitializeItems();
                    if (MarketingNews.ClientsManagersNewsDataTable.Rows.Count == 0)
                    {
                        ClientsManagersMenu.Top    = 0;
                        ClientsManagersMenu.Height = panel1.Height;
                    }
                    else
                    {
                        cbtnManagers.Checked            = true;
                        ClientsManagersMenu.Top         = 239;
                        ClientsManagersMenu.Height      = panel1.Height - ClientsManagersMenu.Top;
                        NewClientsManagersMenu.Selected = 0;
                        ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name);
                    }
                }
                else
                {
                    ClientsMenu.Top         = 239;
                    ClientsMenu.Height      = panel1.Height - ClientsMenu.Top;
                    NewClientsMenu.Selected = 0;
                    ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name);
                }
            }
            if (cbtnManagers.Checked)
            {
                MarketingNews.FillNewManagersNews();

                NewClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersNewsDataTable;
                NewClientsManagersMenu.InitializeItems();
                if (MarketingNews.ClientsManagersNewsDataTable.Rows.Count == 0)
                {
                    ClientsManagersMenu.Top    = 0;
                    ClientsManagersMenu.Height = panel1.Height;

                    MarketingNews.FillNewClientsNews();

                    NewClientsMenu.ClientsDataTable = MarketingNews.ClientsNewsDataTable;
                    NewClientsMenu.InitializeItems();
                    if (MarketingNews.ClientsNewsDataTable.Rows.Count == 0)
                    {
                        ClientsMenu.Top    = 0;
                        ClientsMenu.Height = panel1.Height;
                    }
                    else
                    {
                        cbtnClients.Checked     = true;
                        ClientsMenu.Top         = 239;
                        ClientsMenu.Height      = panel1.Height - ClientsMenu.Top;
                        NewClientsMenu.Selected = 0;
                        ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name);
                    }
                }
                else
                {
                    ClientsManagersMenu.Top         = 239;
                    ClientsManagersMenu.Height      = panel1.Height - ClientsManagersMenu.Top;
                    NewClientsManagersMenu.Selected = 0;
                    ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name);
                }
            }

            UpdateNewsButton.Visible = false;

            bC = true;
        }
Exemple #2
0
        private void kryptonCheckSet1_CheckedButtonChanged(object sender, EventArgs e)
        {
            if (MarketingNews == null)
            {
                return;
            }
            Thread T = new Thread(delegate()
            {
                SplashWindow.CreateCoverSplash(LightNewsContainer.Top, LightNewsContainer.Left,
                                               LightNewsContainer.Height, LightNewsContainer.Width);
            });

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }

            MarketingNews.FillLikes();

            if (cbtnClients.Checked)
            {
                ClientsMenu.ClientsDataTable = MarketingNews.ClientsDataTable;
                ClientsMenu.InitializeItems();
                ClientsMenu.Selected = 0;

                MarketingNews.FillNews(ClientsMenu.Items[ClientsMenu.Selected].ClientID);
                MarketingNews.FillNewClientsNews();

                NewClientsMenu.ClientsDataTable = MarketingNews.ClientsNewsDataTable;
                NewClientsMenu.InitializeItems();


                if (ClientsMenu.Selected == -1)
                {
                    MarketingNews.ReloadClientsNews(20, NewClientsMenu.Items[NewClientsMenu.Selected].ClientID);
                }
                else
                {
                    MarketingNews.ReloadClientsNews(20, ClientsMenu.Items[ClientsMenu.Selected].ClientID);
                }
                if (MarketingNews.ClientsNewsDataTable.Rows.Count == 0)
                {
                    ClientsMenu.Top    = 0;
                    ClientsMenu.Height = panel1.Height;
                }
                else
                {
                    ClientsMenu.Top         = 239;
                    ClientsMenu.Height      = panel1.Height - ClientsMenu.Top;
                    NewClientsMenu.Selected = 0;
                    ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name);
                }
                panel1.BringToFront();
            }
            else
            {
                ClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersDataTable;
                ClientsManagersMenu.InitializeItems();
                ClientsManagersMenu.Selected = 0;

                MarketingNews.FillMNews(ClientsManagersMenu.Items[ClientsManagersMenu.Selected].ClientID);
                MarketingNews.FillNewManagersNews();

                NewClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersNewsDataTable;
                NewClientsManagersMenu.InitializeItems();

                if (ClientsManagersMenu.Selected == -1)
                {
                    MarketingNews.ReloadManagersNews(20, NewClientsManagersMenu.Items[NewClientsManagersMenu.Selected].ClientID);
                }
                else
                {
                    MarketingNews.ReloadManagersNews(20, ClientsManagersMenu.Items[ClientsManagersMenu.Selected].ClientID);
                }
                if (MarketingNews.ClientsManagersNewsDataTable.Rows.Count == 0)
                {
                    ClientsManagersMenu.Top    = 0;
                    ClientsManagersMenu.Height = panel4.Height;
                }
                else
                {
                    ClientsManagersMenu.Top         = 239;
                    ClientsManagersMenu.Height      = panel4.Height - ClientsManagersMenu.Top;
                    NewClientsManagersMenu.Selected = 0;
                    ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name);
                }
                panel4.BringToFront();
            }

            MarketingNews.ReloadComments();
            MarketingNews.ReloadAttachments();
            LightNewsContainer.NewsDataTable = MarketingNews.NewsDataTable.Copy();
            LightNewsContainer.CommentsDT    = MarketingNews.CommentsDataTable.Copy();
            LightNewsContainer.AttachsDT     = MarketingNews.AttachmentsDataTable.Copy();
            LightNewsContainer.CreateNews();
            LightNewsContainer.ScrollToTop();
            LightNewsContainer.Focus();
            bC = true;
        }
Exemple #3
0
        public MarketingNewsForm(LightStartForm tLightStartForm)
        {
            InitializeComponent();

            LightStartForm = tLightStartForm;

            this.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;

            MarketingNews = new Infinium.MarketingNews();
            MarketingNews.FillLikes();

            Initialize();

            ClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersDataTable;
            ClientsManagersMenu.InitializeItems();
            ClientsManagersMenu.Selected = 0;

            MarketingNews.FillMNews(ClientsManagersMenu.Items[ClientsManagersMenu.Selected].ClientID);
            MarketingNews.FillNewManagersNews();

            NewClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersNewsDataTable;
            NewClientsManagersMenu.InitializeItems();

            ClientsMenu.ClientsDataTable = MarketingNews.ClientsDataTable;
            ClientsMenu.InitializeItems();
            ClientsMenu.Selected = 0;

            MarketingNews.FillNews(ClientsMenu.Items[ClientsMenu.Selected].ClientID);
            MarketingNews.FillNewClientsNews();

            NewClientsMenu.ClientsDataTable = MarketingNews.ClientsNewsDataTable;
            NewClientsMenu.InitializeItems();

            if (MarketingNews.ClientsNewsDataTable.Rows.Count == 0)
            {
                ClientsMenu.Top    = 0;
                ClientsMenu.Height = panel1.Height;
                if (MarketingNews.ClientsManagersNewsDataTable.Rows.Count == 0)
                {
                    ClientsManagersMenu.Top    = 0;
                    ClientsManagersMenu.Height = panel4.Height;
                    return;
                }
                else
                {
                    NewClientsManagersMenu.Selected = 0;
                    cbtnManagers.Checked            = true;
                    ClientsManagersMenu.Top         = 239;
                    ClientsManagersMenu.Height      = panel4.Height - ClientsManagersMenu.Top;
                    ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name);
                }
                return;
            }
            else
            {
                ClientsMenu.Top         = 239;
                ClientsMenu.Height      = panel1.Height - ClientsMenu.Top;
                NewClientsMenu.Selected = 0;
                ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name);
            }


            while (!SplashForm.bCreated)
            {
                ;
            }
        }