Ejemplo n.º 1
0
        private void Loading()
        {
            data     = new Database.MysqlMessage();
            Messages = data.MysqlUserMessages();
            Style MessageStackLabel = Application.Current.FindResource("MessageStackLabel") as Style;
            Style ListStackPanel    = Application.Current.FindResource("ListStackPanel") as Style;
            Style ButtonsStyle      = Application.Current.FindResource("Buttons_X") as Style;

            rendezes(Messages);

            for (int i = 0; i < Messages.Count; i++)
            {
                StackPanel panel = new StackPanel();
                panel.Orientation = Orientation.Horizontal;
                panel.Margin      = new Thickness(0, 0, 0, 2);
                panel.Height      = 48;
                panel.Width       = 793;
                panel.MouseDown  += new MouseButtonEventHandler(dpMouse_Click);
                panel.Uid         = i.ToString();

                Label Info = new Label();
                if (Messages[i].NEWbl)
                {
                    Info.Content = Messages[i].NEWstr;
                    Info.Style   = MessageStackLabel;
                }
                if (Messages[i].BlVissza)
                {
                    Info.Content = Messages[i].StrVissza;
                    Info.Style   = MessageStackLabel;
                }
                if (!Messages[i].NEWbl && !Messages[i].BlVissza)
                {
                    Info.Content = "Lezárt!";
                    Info.Style   = MessageStackLabel;
                }
                if (Messages[i].NEWbl && Messages[i].felado_id == Globals.User.member_id && !Messages[i].BlVissza)
                {
                    Info.Content = "Foglalási kérelem!";
                    Info.Style   = MessageStackLabel;
                }
                Info.Width = 120;

                Label Felado = new Label();
                Felado.Content = "Feladó: " + Messages[i].felado_nev;
                Felado.Style   = MessageStackLabel;
                Felado.Width   = 247;

                Label Targy = new Label();
                if (Messages[i].device_id != 0)
                {
                    Targy.Content = "Tárgy: Szállitó bérlés!";
                }
                else if (Messages[i].yacht_id != 0)
                {
                    Targy.Content = "Tárgy: Yacht bérlés";
                }
                Targy.Style = MessageStackLabel;
                Targy.Width = 180;

                Label Kelte = new Label();
                Kelte.Content = "Kelt.: " + Messages[i].keletkezett.ToString();
                Kelte.Style   = MessageStackLabel;
                Kelte.Width   = 200;

                Button X = new Button();
                X.Height  = 20;
                X.Width   = 20;
                X.Uid     = Messages[i].uzenet_id.ToString();
                X.Content = "X";
                X.Style   = ButtonsStyle;
                X.Click  += new RoutedEventHandler(Delete_Click);

                panel.Children.Add(Info);
                panel.Children.Add(Felado);
                panel.Children.Add(Targy);
                panel.Children.Add(Kelte);
                panel.Children.Add(X);

                panel.Style = ListStackPanel;

                spList.Children.Add(panel);
            }
        }
Ejemplo n.º 2
0
        public ucBerbeadott()
        {
            InitializeComponent();
            Globals.UpdateHistory();
            Style MenuStackLabel = Application.Current.FindResource("MenuStackLabel") as Style;
            Style ListStackPanel = Application.Current.FindResource("ListStackPanel") as Style;

            data     = new Database.MysqlMessage();
            Messages = data.MysqlUserMessages();

            for (int i = 0; i < Messages.Count; i++)
            { // ha a címzettid=jelenlegi user id vel, és el van fogadva és yachtot bérelt
                if (Messages[i].cimzett_id == Globals.User.member_id && Messages[i].elfogadvabl && Messages[i].yacht_id > 0)
                {
                    StackPanel st = new StackPanel();
                    st.Orientation = Orientation.Horizontal;
                    st.Margin      = new Thickness(0, 0, 0, 2);
                    st.Height      = 53;
                    st.Background  = Globals.MainTheme.hatter;
                    st.Style       = ListStackPanel;
                    st.Uid         = i.ToString();
                    st.MouseDown  += St_MouseDown;

                    StackPanel panel1 = new StackPanel();
                    panel1.Width = 220;
                    StackPanel panel2 = new StackPanel();

                    Label Kinek  = new Label();
                    Label Mit    = new Label();
                    Label Mettol = new Label();
                    Label Meddig = new Label();

                    Kinek.Style  = MenuStackLabel;
                    Mit.Style    = MenuStackLabel;
                    Mettol.Style = MenuStackLabel;
                    Meddig.Style = MenuStackLabel;

                    Kinek.Content  = "Bérlő neve: " + Messages[i].felado_nev;
                    Kinek.Height   = 26.5;
                    Mit.Content    = "Yach neve: " + Messages[i].yacht_nev;
                    Mit.Height     = 26.5;
                    Mettol.Content = "Mettől: " + Messages[i].kezdete.ToLongDateString();
                    Mettol.Height  = 26.5;
                    Meddig.Content = "Meddig: " + Messages[i].vege.ToLongDateString();
                    Meddig.Height  = 26.5;

                    panel1.Children.Add(Kinek);
                    panel1.Children.Add(Mit);
                    panel2.Children.Add(Mettol);
                    panel2.Children.Add(Meddig);

                    st.Children.Add(panel1);
                    st.Children.Add(panel2);

                    stPanel1.Children.Add(st);
                } // ha a címzettid=jelenlegi user id vel, és el van fogadva és szállítóeszközt bérelt
                if (Messages[i].cimzett_id == Globals.User.member_id && Messages[i].elfogadvabl == true && Messages[i].device_id > 0)
                {
                    StackPanel st = new StackPanel();
                    st.Orientation = Orientation.Horizontal;
                    st.Margin      = new Thickness(0, 0, 0, 2);
                    st.Height      = 53;
                    st.Background  = Globals.MainTheme.hatter;
                    st.Style       = ListStackPanel;
                    st.Uid         = i.ToString();
                    st.MouseDown  += St_MouseDown;

                    StackPanel panel1 = new StackPanel();
                    panel1.Width = 220;
                    StackPanel panel2 = new StackPanel();

                    Label Kinek  = new Label();
                    Label Mit    = new Label();
                    Label Mettol = new Label();
                    Label Meddig = new Label();

                    Kinek.Style  = MenuStackLabel;
                    Mit.Style    = MenuStackLabel;
                    Mettol.Style = MenuStackLabel;
                    Meddig.Style = MenuStackLabel;

                    Kinek.Content  = "Bérlő neve: " + Messages[i].felado_nev;
                    Kinek.Height   = 26.5;
                    Mit.Content    = "Szállitó ID: " + Messages[i].device_id;
                    Mit.Height     = 26.5;
                    Mettol.Content = "Mettől: " + Messages[i].kezdete.ToLongDateString();
                    Mettol.Height  = 26.5;
                    Meddig.Content = "Meddig: " + Messages[i].vege.ToLongDateString();
                    Meddig.Height  = 26.5;

                    panel1.Children.Add(Kinek);
                    panel1.Children.Add(Mit);
                    panel2.Children.Add(Mettol);
                    panel2.Children.Add(Meddig);

                    st.Children.Add(panel1);
                    st.Children.Add(panel2);

                    stPanel2.Children.Add(st);
                }
            }
        }