Пример #1
0
        private BunifuSeparator addSeparator(int i)
        {
            BunifuSeparator separator = new BunifuSeparator();

            separator.Name     = "buSeparator_" + i.ToString();
            separator.Location = new Point(61, 35);
            separator.Size     = new Size(425, 28);

            return(separator);
        }
Пример #2
0
        private void LoadHoaDonKhachHang(int hoaDonID)
        {
            flowLayoutPanel4.Controls.Clear();
            DataSet ds1 = new DataSet();

            ds1 = cthdkhbll.GetListChiTietHoaDonFromHoaDonID(hoaDonID);

            foreach (DataRow dtr in ds1.Tables[0].Rows)
            {
                BunifuImageButton btnDeleteMon = new BunifuImageButton();
                btnDeleteMon.BackColor   = System.Drawing.Color.Transparent;
                btnDeleteMon.Image       = Image.FromFile(@"D:\Phân tích và thiết kế hệ thống thông tin\appCoffee\Pictures\png\icon.png");
                btnDeleteMon.ImageActive = null;
                btnDeleteMon.Location    = new System.Drawing.Point(5, 9);
                btnDeleteMon.Name        = dtr["monID"].ToString();
                btnDeleteMon.Click      += new EventHandler(btnDeleteMonClick);

                btnDeleteMon.Size     = new System.Drawing.Size(18, 15);
                btnDeleteMon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
                btnDeleteMon.TabIndex = 13;
                btnDeleteMon.TabStop  = false;
                btnDeleteMon.Zoom     = 10;

                Label lbTenMon = new Label();
                lbTenMon.AutoSize = true;
                lbTenMon.Location = new System.Drawing.Point(38, 10);
                lbTenMon.Name     = "lbTenMon";
                lbTenMon.Size     = new System.Drawing.Size(49, 13);
                lbTenMon.TabIndex = 14;
                lbTenMon.Text     = dtr["tenMon"].ToString();

                Label lbSoLuong = new Label();
                lbSoLuong.AutoSize = true;
                lbSoLuong.Location = new System.Drawing.Point(253, 2);
                lbSoLuong.Name     = "lbSoLuong";
                lbSoLuong.Size     = new System.Drawing.Size(13, 13);
                lbSoLuong.TabIndex = 16;
                lbSoLuong.Text     = dtr["soLuong"].ToString();

                BunifuSeparator bunifuSeparator3 = new BunifuSeparator();
                bunifuSeparator3.BackColor     = System.Drawing.Color.Transparent;
                bunifuSeparator3.LineColor     = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
                bunifuSeparator3.LineThickness = 1;
                bunifuSeparator3.Location      = new System.Drawing.Point(236, 8);
                bunifuSeparator3.Name          = "bunifuSeparator3";
                bunifuSeparator3.Size          = new System.Drawing.Size(43, 9);
                bunifuSeparator3.TabIndex      = 15;
                bunifuSeparator3.Transparency  = 255;
                bunifuSeparator3.Vertical      = false;

                Label lbGia = new Label();
                lbGia.AutoSize = true;
                lbGia.Location = new System.Drawing.Point(239, 17);
                lbGia.Name     = "lbGia";
                lbGia.Size     = new System.Drawing.Size(40, 13);
                lbGia.TabIndex = 17;
                lbGia.Text     = dtr["gia"].ToString();

                BunifuSeparator bunifuSeparator2 = new BunifuSeparator();
                bunifuSeparator2.BackColor     = System.Drawing.Color.Transparent;
                bunifuSeparator2.LineColor     = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(211)))), ((int)(((byte)(211)))));
                bunifuSeparator2.LineThickness = 1;
                bunifuSeparator2.Location      = new System.Drawing.Point(2, 24);
                bunifuSeparator2.Name          = "bunifuSeparator2";
                bunifuSeparator2.Size          = new System.Drawing.Size(287, 20);
                bunifuSeparator2.TabIndex      = 12;
                bunifuSeparator2.Transparency  = 255;
                bunifuSeparator2.Vertical      = false;

                Panel panel7 = new Panel();
                panel7.Dock     = System.Windows.Forms.DockStyle.Top;
                panel7.Location = new System.Drawing.Point(3, 3);
                panel7.Name     = "panel7";
                panel7.Size     = new System.Drawing.Size(290, 45);
                panel7.TabIndex = 1;
                panel7.Controls.Add(btnDeleteMon);
                panel7.Controls.Add(lbTenMon);
                panel7.Controls.Add(lbSoLuong);
                panel7.Controls.Add(bunifuSeparator3);
                panel7.Controls.Add(lbGia);
                panel7.Controls.Add(bunifuSeparator2);

                flowLayoutPanel4.Controls.Add(panel7);
            }
        }
Пример #3
0
        private void loadEmail()
        {
            MySqlDataAdapter ad;
            MySqlConnection  con = new MySqlConnection();

            con.ConnectionString = login.dbConnection;
            string detail = "select * from users where username = '******'";

            MySqlCommand com = new MySqlCommand(detail, con);

            try
            {
                con.Open();

                ad = new MySqlDataAdapter(com);
                //taking email to the table for searchimg its corresponding messages in sentmail table
                DataTable table = new DataTable();
                ad.Fill(table);
                string userEmail = table.Rows[0][3].ToString();
                ad.Dispose();

                //reading all emails correspond to the user email
                string readEmail  = "select mailsubject,senderemail from trash where receiveremail = '" + userEmail + "'";
                string readMesage = "select * from trash where receiveremail = '" + userEmail + "' order by sentmail_id desc";
                //for reading the message in the file
                MySqlCommand com2 = new MySqlCommand(readMesage, con);

                ad = new MySqlDataAdapter(com2);
                DataTable table2 = new DataTable();
                ad.Fill(table2);
                for (int i = 0; i < table2.Rows.Count; i++)
                {
                    //Take the email
                    string subject = table2.Rows[i][1].ToString();
                    Label  email   = new Label();
                    email           = new Label();
                    email.Name      = table2.Rows[i][0].ToString();
                    email.AutoSize  = true;
                    email.ForeColor = Color.FromArgb(64, 64, 64);
                    email.Font      = new Font("Cambria", 15, FontStyle.Regular);
                    email.Text      = subject;
                    email.Cursor    = Cursors.Hand;
                    email.Click    += new EventHandler(email_Click);

                    //seperator for the emails
                    BunifuSeparator spr = new BunifuSeparator();
                    spr.LineThickness = 1;
                    spr.Height        = 1;
                    spr.Anchor        = AnchorStyles.Right;
                    spr.LineColor     = Color.FromArgb(20, 105, 105, 105);
                    spr.Transparency  = 30;
                    //adding the subjects to the pannel
                    flowLayoutPanel1.Controls.Add(email);
                    flowLayoutPanel1.Controls.Add(spr);
                }
                check = true;
                ad.Dispose();
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            con.Close();
        }
Пример #4
0
        private void loadChats()
        {
            MySqlConnection con = new MySqlConnection();

            con.ConnectionString = login.dbConnection;


            //query to check if the chat is added at instant
            string chat = "SELECT chat_id, chat,uname,status FROM chats order by chat_id DESC LIMIT 1";


            MySqlCommand    com = new MySqlCommand(chat, con);
            MySqlDataReader rd;
            DataTable       table1 = new DataTable();

            try
            {
                con.Open();
                //taking the chat
                rd = com.ExecuteReader();
                table1.Load(rd);
                rd.Close();

                for (int j = 0; j < table1.Rows.Count; j++)
                {
                    if (table1.Rows[j][3].ToString() == "New")
                    {
                        //Username
                        Label uname = new Label();
                        uname          = new Label();
                        uname.Name     = table1.Rows[j][0].ToString();
                        uname.AutoSize = true;
                        if (changeUsernameColor1 == 0)
                        {
                            uname.ForeColor = Color.Indigo;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 1)
                        {
                            uname.ForeColor = Color.Green;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 2)
                        {
                            uname.ForeColor = Color.Yellow;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 3)
                        {
                            uname.ForeColor = Color.Aqua;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 4)
                        {
                            uname.ForeColor = Color.Brown;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 5)
                        {
                            uname.ForeColor = Color.FromArgb(30, 0, 40);
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 6)
                        {
                            uname.ForeColor = Color.Chocolate;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 7)
                        {
                            uname.ForeColor = Color.LightGreen;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 8)
                        {
                            uname.ForeColor = Color.LightPink;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 9)
                        {
                            uname.ForeColor = Color.LightYellow;
                            changeUsernameColor1++;
                        }
                        else if (changeUsernameColor1 == 10)
                        {
                            uname.ForeColor = Color.Magenta;
                            changeUsernameColor1++;
                        }
                        else
                        {
                            changeUsernameColor1 = 0;
                        }
                        uname.Font = new Font("Cambria", 12, FontStyle.Bold);
                        uname.Text = table1.Rows[j][2].ToString();;

                        //chat message
                        Label chatSms = new Label();
                        chatSms.Name      = table1.Rows[j][0].ToString();
                        chatSms.AutoSize  = true;
                        chatSms.ForeColor = Color.LightGray;
                        chatSms.Font      = new Font("Cambria", 12);
                        chatSms.Text      = table1.Rows[j][1].ToString();

                        //separater
                        BunifuSeparator spr = new BunifuSeparator();
                        spr.LineThickness = 2;
                        spr.Height        = 1;
                        spr.Anchor        = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
                        spr.LineColor     = Color.DarkBlue;
                        spr.Transparency  = 30;

                        //adding user name to the panel

                        flowLayoutPanel1.Controls.Add(chatSms);
                        flowLayoutPanel1.Controls.Add(uname);
                        flowLayoutPanel1.Controls.Add(spr);

                        //changing the chat to read
                        string       update = "update chats set status = 'Read' where chat_id = '" + table1.Rows[j][0] + "'";
                        MySqlCommand com1   = new MySqlCommand(update, con);
                        rd = com1.ExecuteReader();
                        rd.Close();
                    }
                    else
                    {
                    }
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            con.Close();
        }
Пример #5
0
        private Panel createEventsForAgenda(DataRow row)
        {
            Panel containerPanel = new Panel();

            containerPanel.Name      = row["Código de Barras"].ToString();
            containerPanel.BackColor = Color.Transparent;
            containerPanel.Size      = new Size(this.NotificationPanel.Width, this.NotificationContainerPanel.Height / 5);
            Panel panel1 = new Panel();

            panel1.BackColor = Color.Transparent;
            panel1.Dock      = DockStyle.Left;
            panel1.Size      = new Size(this.NotificationContainerPanel.Width / 4, this.NotificationContainerPanel.Height / 4);
            panel1.Padding   = new Padding(5);

            BunifuSeparator bunifuSeparator = new BunifuSeparator();

            bunifuSeparator.LineThickness = 3;
            bunifuSeparator.Height        = 3;
            bunifuSeparator.LineColor     = Color.Yellow;

            var p = new Producto(row["Código de Barras"].ToString());

            panel1.Controls.Add(new PictureBox()
            {
                Image     = p.image,
                Dock      = DockStyle.Fill,
                SizeMode  = PictureBoxSizeMode.Zoom,
                BackColor = p.image != null ? Color.White : Color.Transparent
            });

            bunifuSeparator.BringToFront();
            Panel panel2 = new Panel();

            panel2.BackColor = Color.Transparent;
            panel2.Dock      = DockStyle.Fill;


            Label label2 = new Label();

            label2.Dock      = DockStyle.Top;
            label2.BackColor = Color.Transparent;
            label2.ForeColor = Color.Yellow;
            label2.Font      = new Font("century gothic", 20f, FontStyle.Bold);
            label2.TextAlign = ContentAlignment.MiddleLeft;
            label2.AutoSize  = false;
            label2.Size      = new Size(100, panel2.Height / 2);
            label2.Text      = row["Descripción"].ToString();

            Label label3 = new Label();

            label3.Dock      = DockStyle.Fill;
            label3.BackColor = Color.FromArgb(0, Color.White);
            label3.ForeColor = Color.White;
            label3.Font      = new Font("century gothic", 20f, FontStyle.Bold);
            label3.TextAlign = ContentAlignment.TopLeft;
            label3.AutoSize  = false;
            label3.Text      = row["Marca"].ToString();
            panel2.Controls.Add((Control)label2);
            panel2.Controls.Add((Control)label3);
            label3.BringToFront();


            containerPanel.Controls.Add((Control)panel1);
            containerPanel.Controls.Add((Control)panel2);


            panel2.BringToFront();



            containerPanel.Controls.Add(bunifuSeparator);
            bunifuSeparator.Dock = DockStyle.Bottom;


            label2.DoubleClick += (s, e) =>
                                  openProduct((s as Label).Parent.Parent.Name);

            label3.DoubleClick += (s, e) =>
                                  openProduct((s as Label).Parent.Parent.Name);

            containerPanel.DoubleClick += (s, e) =>
                                          openProduct((s as Panel).Parent.Name);

            panel1.Controls[0].DoubleClick += (s, e) =>
                                              openProduct((s as PictureBox).Parent.Parent.Name);


            label2.MouseEnter += (s, e) =>
                                 mouseEnter((s as Label).Parent.Parent);

            label3.MouseEnter += (s, e) =>
                                 mouseEnter((s as Label).Parent.Parent);

            containerPanel.MouseEnter += (s, e) =>
                                         mouseEnter((s as Panel).Parent);

            panel1.Controls[0].MouseEnter += (s, e) =>
                                             mouseEnter((s as PictureBox).Parent.Parent);


            label2.MouseLeave += (s, e) =>
                                 mouseLeave((s as Label).Parent.Parent);

            label3.MouseLeave += (s, e) =>
                                 mouseLeave((s as Label).Parent.Parent);

            containerPanel.MouseLeave += (s, e) =>
                                         mouseLeave((s as Panel).Parent);

            panel1.Controls[0].MouseLeave += (s, e) =>
                                             mouseLeave((s as PictureBox).Parent.Parent);

            return(containerPanel);
        }
Пример #6
0
        private void OgeOlustur(DateTime entryDate, string strMetin, int isOpen)
        {
            Panel           subitem_item                    = new Panel();
            BunifuSeparator subitem_seperator               = new BunifuSeparator();
            Label           subitem_date                    = new Label();
            Panel           subitem_panel_textframe         = new Panel();
            Panel           subpanel_item_panel_rightbutton = new Panel();

            Bunifu.Framework.UI.BunifuThinButton2 subitem_button_rightbutton = new Bunifu.Framework.UI.BunifuThinButton2();
            //
            // subitem_item
            //
            if (subitem_count % 2 == 0)
            {
                subitem_item.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(215)))));
            }
            else
            {
                subitem_item.BackColor = Color.White;
            }
            subitem_count++;

            subitem_item.Controls.Add(subitem_panel_textframe);
            subitem_item.Controls.Add(subpanel_item_panel_rightbutton);
            subitem_item.Controls.Add(subitem_seperator);
            subitem_item.Controls.Add(subitem_date);
            subitem_item.Margin = new System.Windows.Forms.Padding(0);
            subitem_item.Name   = "subitem_item";
            subitem_item.Size   = new System.Drawing.Size(805, 40);
            subitem_item.Tag    = isOpen;
            //
            // subitem_seperator
            //
            subitem_seperator.BackColor             = System.Drawing.Color.Transparent;
            subitem_seperator.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            subitem_seperator.LineColor             = System.Drawing.Color.Black;
            subitem_seperator.LineStyle             = Bunifu.UI.WinForms.BunifuSeparator.LineStyles.DoubleEdgeFaded;
            subitem_seperator.LineThickness         = 1;
            subitem_seperator.Location    = new System.Drawing.Point(148, 5);
            subitem_seperator.Name        = "subitem_seperator";
            subitem_seperator.Orientation = Bunifu.UI.WinForms.BunifuSeparator.LineOrientation.Vertical;
            subitem_seperator.Size        = new System.Drawing.Size(32, 1);
            subitem_seperator.TabIndex    = 1;
            //
            // subitem_date
            //
            subitem_date.AutoSize = true;
            subitem_date.Font     = new System.Drawing.Font("Microsoft Sans Serif", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
            subitem_date.Location = new System.Drawing.Point(6, 11);
            subitem_date.Name     = "subitem_date";
            subitem_date.Size     = new System.Drawing.Size(112, 18);
            subitem_date.TabIndex = 0;
            subitem_date.Text     = entryDate.ToString();
            //
            // subpanel_item_panel_rightbutton
            //
            subpanel_item_panel_rightbutton.Controls.Add(subitem_button_rightbutton);
            subpanel_item_panel_rightbutton.Dock      = System.Windows.Forms.DockStyle.Right;
            subpanel_item_panel_rightbutton.Location  = new System.Drawing.Point(673, 0);
            subpanel_item_panel_rightbutton.Name      = "subpanel_item_panel_rightbutton";
            subpanel_item_panel_rightbutton.Padding   = new System.Windows.Forms.Padding(1);
            subpanel_item_panel_rightbutton.Size      = new System.Drawing.Size(60, 40);
            subpanel_item_panel_rightbutton.TabIndex  = 3;
            subpanel_item_panel_rightbutton.BackColor = Color.Transparent;
            subpanel_item_panel_rightbutton.Visible   = false;
            //
            // subitem_button_rightbutton
            //
            subitem_button_rightbutton.ActiveBorderThickness = 1;
            subitem_button_rightbutton.ActiveCornerRadius    = 20;
            subitem_button_rightbutton.ActiveFillColor       = System.Drawing.Color.SeaGreen;
            subitem_button_rightbutton.ActiveForecolor       = System.Drawing.Color.White;
            subitem_button_rightbutton.ActiveLineColor       = System.Drawing.Color.SeaGreen;
            subitem_button_rightbutton.BackColor             = Color.Transparent;
            subitem_button_rightbutton.ButtonText            = "İncele";
            subitem_button_rightbutton.Cursor              = System.Windows.Forms.Cursors.Hand;
            subitem_button_rightbutton.Dock                = System.Windows.Forms.DockStyle.Fill;
            subitem_button_rightbutton.Font                = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            subitem_button_rightbutton.ForeColor           = System.Drawing.Color.SeaGreen;
            subitem_button_rightbutton.IdleBorderThickness = 1;
            subitem_button_rightbutton.IdleCornerRadius    = 20;
            subitem_button_rightbutton.IdleFillColor       = System.Drawing.Color.White;
            subitem_button_rightbutton.IdleForecolor       = System.Drawing.Color.SeaGreen;
            subitem_button_rightbutton.IdleLineColor       = System.Drawing.Color.SeaGreen;
            subitem_button_rightbutton.Location            = new System.Drawing.Point(1, 1);
            subitem_button_rightbutton.Margin              = new System.Windows.Forms.Padding(5);
            subitem_button_rightbutton.Name                = "subitem_button_rightbutton";
            subitem_button_rightbutton.Size                = new System.Drawing.Size(120, 38);
            subitem_button_rightbutton.TabIndex            = 0;
            subitem_button_rightbutton.TextAlign           = System.Drawing.ContentAlignment.MiddleCenter;
            subitem_button_rightbutton.Click              += new EventHandler(Subitem_button_rightbutton_Click);
            subitem_button_rightbutton.Visible             = false;
            //
            // subitem_panel_textframe
            //
            subitem_panel_textframe.Dock     = System.Windows.Forms.DockStyle.Right;
            subitem_panel_textframe.Location = new System.Drawing.Point(20, 0);
            subitem_panel_textframe.Name     = "subitem_panel_textframe";
            subitem_panel_textframe.Padding  = new System.Windows.Forms.Padding(1);
            subitem_panel_textframe.Size     = new System.Drawing.Size(650, 40);
            subitem_panel_textframe.TabIndex = 4;
            subitem_panel_textframe.Paint   += new PaintEventHandler(AddPaintedText);
            text = strMetin;

            subitem_seperator.Orientation = BunifuSeparator.LineOrientation.Vertical;

            this.vscrollbar1.LargeChange = this.vscrollbar1.Maximum / 2;

            p_panel.Controls.Add(subitem_item);
            p_panel.Refresh();
        }
Пример #7
0
 public void InitializeComponent()
 {
     bunifuCustomTextbox1 = new BunifuCustomTextbox();
     bunifuCustomLabel1   = new BunifuCustomLabel();
     bunifuCustomLabel2   = new BunifuCustomLabel();
     bunifuCustomLabel3   = new BunifuCustomLabel();
     bunifuCustomLabel4   = new BunifuCustomLabel();
     bunifuSeparator1     = new BunifuSeparator();
     pictureBox1          = new PictureBox();
     bunifuCustomLabel5   = new BunifuCustomLabel();
     bunifuSeparator2     = new BunifuSeparator();
     ((ISupportInitialize)pictureBox1).BeginInit();
     base.SuspendLayout();
     bunifuCustomTextbox1.BackColor   = Color.White;
     bunifuCustomTextbox1.BorderColor = Color.SeaGreen;
     bunifuCustomTextbox1.BorderStyle = BorderStyle.FixedSingle;
     bunifuCustomTextbox1.Font        = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     bunifuCustomTextbox1.Location    = new Point(16, 12);
     bunifuCustomTextbox1.Multiline   = true;
     bunifuCustomTextbox1.Name        = "bunifuCustomTextbox1";
     bunifuCustomTextbox1.ScrollBars  = ScrollBars.Horizontal;
     bunifuCustomTextbox1.Size        = new Size(345, 402);
     bunifuCustomTextbox1.TabIndex    = 0;
     bunifuCustomLabel1.AutoSize      = true;
     bunifuCustomLabel1.Font          = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     bunifuCustomLabel1.Location      = new Point(390, 54);
     bunifuCustomLabel1.Name          = "bunifuCustomLabel1";
     bunifuCustomLabel1.Size          = new Size(117, 16);
     bunifuCustomLabel1.TabIndex      = 1;
     bunifuCustomLabel1.Text          = "Last Stub Update :";
     bunifuCustomLabel2.AutoSize      = true;
     bunifuCustomLabel2.Font          = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     bunifuCustomLabel2.Location      = new Point(525, 54);
     bunifuCustomLabel2.Name          = "bunifuCustomLabel2";
     bunifuCustomLabel2.Size          = new Size(70, 16);
     bunifuCustomLabel2.TabIndex      = 2;
     bunifuCustomLabel2.Text          = "25 - 11 - 16";
     bunifuCustomLabel2.Click        += bunifuCustomLabel2_Click;
     bunifuCustomLabel3.AutoSize      = true;
     bunifuCustomLabel3.Font          = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     bunifuCustomLabel3.Location      = new Point(525, 16);
     bunifuCustomLabel3.Name          = "bunifuCustomLabel3";
     bunifuCustomLabel3.Size          = new Size(70, 16);
     bunifuCustomLabel3.TabIndex      = 4;
     bunifuCustomLabel3.Text          = "25 - 11 - 16";
     bunifuCustomLabel4.AutoSize      = true;
     bunifuCustomLabel4.Font          = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     bunifuCustomLabel4.Location      = new Point(390, 16);
     bunifuCustomLabel4.Name          = "bunifuCustomLabel4";
     bunifuCustomLabel4.Size          = new Size(132, 16);
     bunifuCustomLabel4.TabIndex      = 3;
     bunifuCustomLabel4.Text          = "Last Builder Update :";
     bunifuSeparator1.BackColor       = Color.Transparent;
     bunifuSeparator1.LineColor       = Color.FromArgb(105, 105, 105);
     bunifuSeparator1.LineThickness   = 1;
     bunifuSeparator1.Location        = new Point(393, 241);
     bunifuSeparator1.Name            = "bunifuSeparator1";
     bunifuSeparator1.Size            = new Size(273, 35);
     bunifuSeparator1.TabIndex        = 5;
     bunifuSeparator1.Transparency    = 255;
     bunifuSeparator1.Vertical        = false;
     //	pictureBox1.Image = Resources.user_icon;
     pictureBox1.Location           = new Point(393, 285);
     pictureBox1.Name               = "pictureBox1";
     pictureBox1.Size               = new Size(100, 100);
     pictureBox1.SizeMode           = PictureBoxSizeMode.StretchImage;
     pictureBox1.TabIndex           = 6;
     pictureBox1.TabStop            = false;
     bunifuCustomLabel5.AutoSize    = true;
     bunifuCustomLabel5.Font        = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
     bunifuCustomLabel5.Location    = new Point(502, 287);
     bunifuCustomLabel5.Name        = "bunifuCustomLabel5";
     bunifuCustomLabel5.Size        = new Size(109, 16);
     bunifuCustomLabel5.TabIndex    = 7;
     bunifuCustomLabel5.Text        = "User : Username";
     bunifuSeparator2.BackColor     = Color.Transparent;
     bunifuSeparator2.LineColor     = Color.FromArgb(105, 105, 105);
     bunifuSeparator2.LineThickness = 1;
     bunifuSeparator2.Location      = new Point(393, 391);
     bunifuSeparator2.Name          = "bunifuSeparator2";
     bunifuSeparator2.Size          = new Size(273, 35);
     bunifuSeparator2.TabIndex      = 10;
     bunifuSeparator2.Transparency  = 255;
     bunifuSeparator2.Vertical      = false;
     base.AutoScaleDimensions       = new SizeF(6f, 13f);
     base.AutoScaleMode             = AutoScaleMode.Font;
     AutoScroll      = true;
     BackColor       = Color.White;
     base.ClientSize = new Size(710, 426);
     base.Controls.Add(bunifuSeparator2);
     base.Controls.Add(bunifuCustomLabel5);
     base.Controls.Add(pictureBox1);
     base.Controls.Add(bunifuSeparator1);
     base.Controls.Add(bunifuCustomLabel3);
     base.Controls.Add(bunifuCustomLabel4);
     base.Controls.Add(bunifuCustomLabel2);
     base.Controls.Add(bunifuCustomLabel1);
     base.Controls.Add(bunifuCustomTextbox1);
     base.FormBorderStyle = FormBorderStyle.None;
     base.Name            = "HomeFrm";
     Text       = "HomeFrm";
     base.Load += HomeFrm_Load;
     ((ISupportInitialize)pictureBox1).EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
Пример #8
0
        private void getRemovedEmployees()
        {
            MySqlConnection con = new MySqlConnection();

            con.ConnectionString = Home.DBconnection;

            MySqlCommand com = new MySqlCommand("select empID, upper(CONCAT(fname,' ',mname, ' ',lname)) from employee where state = 'DEACTIVE'", con);

            MySqlDataAdapter da;
            DataTable        tab = new DataTable();

            try
            {
                con.Open();
                da = new MySqlDataAdapter(com);
                da.Fill(tab);
                da.Dispose();

                if (tab.Rows.Count > 0)
                {
                    flowLayoutPanel1.Controls.Clear();

                    lab           = new Label();
                    lab.ForeColor = Color.LightGray;
                    lab.Font      = new Font("Calibri", 14, FontStyle.Bold);
                    lab.AutoSize  = true;

                    lab.Text = tab.Rows[0][1].ToString();

                    //create a line
                    line        = new BunifuSeparator();
                    line.Height = 1;

                    //create a white space

                    pan        = new Panel();
                    pan.Height = 1;
                    pan.Width  = 300;
                    //create a button
                    btn              = new BunifuFlatButton();
                    btn.Iconimage    = null;
                    btn.TextAlign    = ContentAlignment.MiddleCenter;
                    btn.Size         = new Size(100, 20);
                    btn.TextFont     = new Font("Calibri", 10);
                    btn.BorderRadius = 5;
                    btn.Text         = "Restore";
                    btn.Left         = 300;
                    btn.OnHovercolor = Color.Orange;
                    btn.Normalcolor  = Color.FromArgb(217, 164, 0);
                    btn.Activecolor  = Color.FromArgb(217, 164, 0);
                    btn.Cursor       = Cursors.Hand;
                    btn.Name         = tab.Rows[0][0].ToString();
                    btn.Click       += new EventHandler(btn_Click);

                    panel = new FlowLayoutPanel();
                    panel.FlowDirection = FlowDirection.LeftToRight;
                    panel.WrapContents  = false;
                    panel.AutoSize      = true;
                    panel.Padding       = new Padding(0, 0, 0, 0);

                    panel.Controls.Add(lab);
                    panel.Controls.Add(pan);
                    panel.Controls.Add(btn);
                    flowLayoutPanel1.Controls.Add(panel);
                    flowLayoutPanel1.Controls.Add(line);
                }
                else
                {
                    flowLayoutPanel1.Controls.Clear();
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #9
0
        public void ShowProjects()
        {
            try
            {
                ProjectsList = new ObservableCollection <Projects>(TeamBuildingEntities.Projects);
                var chosenProject = ProjectsList[0];
                var thinButtonY   = 325;
                var pictureBoxY   = 75;
                var separatorY    = 375;
                var customLabelY  = 400;
                var likeButtonY   = 395;

                for (int i = 0; i < ProjectsList.Count; i++)
                {
                    BunifuThinButton2 thinButton = new BunifuThinButton2 {
                        Name = "thinButton" + i
                    };
                    chosenProject                 = ProjectsList[Counter];
                    thinButton.ButtonText         = chosenProject.PrjtName;
                    thinButton.Size               = new Size(655, 55);
                    thinButton.IdleLineColor      = Color.White;
                    thinButton.IdleCornerRadius   = 1;
                    thinButton.IdleForecolor      = Color.Black;
                    thinButton.ActiveCornerRadius = 1;
                    thinButton.ActiveFillColor    = Color.White;
                    thinButton.ActiveLineColor    = Color.Black;
                    thinButton.ActiveForecolor    = Color.FromArgb(12, 185, 102);
                    thinButton.TextAlign          = ContentAlignment.MiddleLeft;
                    thinButton.Location           = new Point(50, thinButtonY);
                    thinButtonY    += 400;
                    thinButton.Font = new Font("Century Gothic", 12);

                    PictureBox pictureBox = new PictureBox();
                    pictureBox.SizeMode = PictureBoxSizeMode.CenterImage;
                    pictureBox.Size     = new Size(655, 250);
                    pictureBox.Location = new Point(50, pictureBoxY);
                    if (File.Exists(@"Pictures\" + chosenProject.PrjtImagePath))
                    {
                        pictureBox.Image = new Bitmap(@"Pictures\" + chosenProject.PrjtImagePath);
                    }
                    else
                    {
                        pictureBox.Image = new Bitmap(@"Pictures\default.jpg");
                    }
                    pictureBoxY += 400;

                    BunifuSeparator separator = new BunifuSeparator();
                    separator.Size          = new Size(655, 15);
                    separator.LineColor     = Color.FromArgb(12, 185, 102);
                    separator.LineThickness = 3;
                    separator.Location      = new Point(50, separatorY);
                    separatorY += 400;

                    BunifuCustomLabel customLabel = new BunifuCustomLabel();
                    customLabel.Font     = new Font("Century Gothic", 12);
                    customLabel.Text     = "Likes: " + chosenProject.PjrtLikeCounter;
                    customLabel.Location = new Point(50, customLabelY);
                    customLabelY        += 400;

                    BunifuImageButton likeButton = new BunifuImageButton()
                    {
                        Name = "imageButton" + i
                    };
                    likeButton.Zoom      = 15;
                    likeButton.Size      = new Size(30, 30);
                    likeButton.BackColor = Color.Transparent;
                    likeButton.SizeMode  = PictureBoxSizeMode.StretchImage;
                    likeButton.Image     = bunifuImageButton2.Image;
                    likeButton.Location  = new Point(675, likeButtonY);
                    likeButtonY         += 400;
                    likeButton.Click    += new EventHandler(bunifuImageButton2_Click);

                    Controls.Add(thinButton);
                    Controls.Add(pictureBox);
                    Controls.Add(separator);
                    Controls.Add(customLabel);
                    Controls.Add(likeButton);
                    ++Counter;
                }
            }

            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }
        }
Пример #10
0
        public void ShowProjects(string param = null)
        {
            try
            {
                Counter      = 0;
                ProjectsList = new ObservableCollection <Projects>(TeamBuildingEntities.Projects);
                Projects chosenProject = null;
                var      thinButtonY   = 325;
                var      pictureBoxY   = 75;
                var      separatorY    = 375;
                var      customLabelY  = 400;
                var      likeButtonY   = 395;

                for (int i = 0; i < ProjectsList.Count; i++)
                {
                    BunifuThinButton2 thinButton = new BunifuThinButton2 {
                        Name = "thinButton" + i
                    };
                    chosenProject = ProjectsList[i];
                    if (param != null)
                    {
                        var classes = chosenProject.PrjtClasses.Select(k => k.Classes).Select(m => m.ClassName);
                        if (!classes.Contains(param))
                        {
                            continue;
                        }
                    }
                    thinButton.ButtonText         = chosenProject.PrjtName;
                    thinButton.Size               = new Size(655, 55);
                    thinButton.IdleLineColor      = Color.White;
                    thinButton.IdleCornerRadius   = 1;
                    thinButton.IdleForecolor      = Color.Black;
                    thinButton.ActiveCornerRadius = 1;
                    thinButton.ActiveFillColor    = Color.White;
                    thinButton.ActiveLineColor    = Color.Black;
                    thinButton.ActiveForecolor    = Color.FromArgb(12, 185, 102);
                    thinButton.TextAlign          = ContentAlignment.MiddleLeft;
                    thinButton.Location           = new Point(50, thinButtonY);
                    thinButton.Tag    = (object)ProjectsList[i];
                    thinButtonY      += 400;
                    thinButton.Click += GetProfileInfo;
                    thinButton.Font   = new Font("Century Gothic", 12);

                    PictureBox pictureBox = new PictureBox();
                    pictureBox.SizeMode = PictureBoxSizeMode.CenterImage;
                    pictureBox.Size     = new Size(450, 250);
                    pictureBox.Location = new Point(150, pictureBoxY);
                    if (File.Exists(@"Pictures\" + chosenProject.PrjtImagePath))
                    {
                        pictureBox.Image = new Bitmap(@"Pictures\" + chosenProject.PrjtImagePath);
                    }
                    else
                    {
                        pictureBox.Image = new Bitmap(@"Pictures\default.jpg");
                    }
                    pictureBoxY += 400;

                    BunifuSeparator separator = new BunifuSeparator();
                    separator.Size          = new Size(655, 15);
                    separator.LineColor     = Color.FromArgb(12, 185, 102);
                    separator.LineThickness = 3;
                    separator.Location      = new Point(50, separatorY);
                    separatorY += 400;

                    BunifuCustomLabel customLabel = new BunifuCustomLabel();
                    customLabel.Font     = new Font("Century Gothic", 12);
                    customLabel.Text     = "Likes: " + chosenProject.PjrtLikeCounter;
                    customLabel.Location = new Point(50, customLabelY);
                    customLabelY        += 400;

                    BunifuImageButton likeButton = new BunifuImageButton()
                    {
                        Name = "imageButton" + i
                    };
                    likeButton.Zoom      = 15;
                    likeButton.Size      = new Size(30, 30);
                    likeButton.BackColor = Color.Transparent;
                    likeButton.SizeMode  = PictureBoxSizeMode.StretchImage;
                    List <LikedProjects> lpr = TeamBuildingEntities.LikedProjects.ToList();
                    if (!lpr.Where(b => b.LkdUserId == Connection.Current.UsrId && b.LkdPrjtId == chosenProject.PrjtId).Any())
                    {
                        likeButton.Image = NotLikedProject.Image;
                    }
                    else
                    {
                        likeButton.Image = LikedProject.Image;
                    }
                    likeButton.Location = new Point(675, likeButtonY);
                    likeButtonY        += 400;
                    likeButton.Tag      = chosenProject.PrjtId;
                    likeButton.Click   += Like_project;

                    Controls.Add(thinButton);
                    Controls.Add(pictureBox);
                    Controls.Add(separator);
                    Controls.Add(customLabel);
                    Controls.Add(likeButton);
                }
            }

            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }
        }
Пример #11
0
        public void ShowUsers(string[] people)
        {
            SuspendLayout();
            scrollPanel.ContentAdded = true;

            int topPadding = (int)(4.85 * unit);
            int beginIndex;

            if (people[people.Length - 1] == "e")
            {
                endCommon = true;
            }

            for (int i = 0; i < people.Length / 6; i++)
            {
                beginIndex = i * 6;

                Human currentUser = Human.Parse(people, beginIndex);

                if ((I.UserId == currentUser.UserId) ||
                    (friend.ContainsKey(currentUser.UserId)))
                {
                    continue;
                }

                Panel usersPanel = new Panel();
                usersPanel.Size = new Size(scrollPanel.Width, (int)(25.65 * unit));

                int lastPanelBottom;
                if (scrollPanel.Controls.Count == 0)
                {
                    lastPanelBottom = 0;
                }
                else
                {
                    lastPanelBottom =
                        scrollPanel.Controls[scrollPanel.Controls.Count - 1].Bottom;
                }
                usersPanel.Location = new Point(0, lastPanelBottom + 1);


                AvatarBox avatar = new AvatarBox();
                if (currentUser.Avatar == null)
                {
                    avatar.Image = Properties.Resources.AvatarDefault;
                }
                avatar.SizeMode = PictureBoxSizeMode.StretchImage;
                avatar.Size     = new Size((int)(19 * unit), (int)(19 * unit));

                int topAvatar = GetLeftPosition(avatar.Height, usersPanel.Height);
                avatar.Location = new Point(topAvatar, topAvatar);

                usersPanel.Controls.Add(avatar);


                Label nameLabel = new Label();
                nameLabel.Text      = currentUser.Name + " " + currentUser.Surname;
                nameLabel.Font      = boldChatFont;
                nameLabel.ForeColor = Color.FromArgb(42, 88, 133);
                nameLabel.AutoSize  = true;
                nameLabel.TextAlign = ContentAlignment.BottomCenter;

                int leftPadding = (int)(3 * unit);
                nameLabel.Location = new Point
                                         (avatar.Right + leftPadding, (int)(topPadding * 1.25));

                usersPanel.Controls.Add(nameLabel);

                BunifuThinButton2 addButton = new BunifuThinButton2();
                addButton.ButtonText = "Добавить собеседника";
                addButton.Size       = new Size
                                           ((int)(56.22 * unit), (int)(13.5 * unit));
                addButton.Font = chatFont;

                addButton.BackColor = Color.White;

                addButton.ActiveForecolor    = Color.White;
                addButton.ActiveFillColor    = Color.FromArgb(104, 136, 173);
                addButton.ActiveLineColor    = Color.White;
                addButton.ActiveCornerRadius = 7;

                addButton.IdleForecolor    = Color.White;
                addButton.IdleFillColor    = Color.FromArgb(94, 129, 167);
                addButton.IdleLineColor    = Color.White;
                addButton.IdleCornerRadius = 7;

                addButton.Location = new Point
                                         (usersPanel.Width - addButton.Width - topAvatar, topPadding);
                addButton.Click += AddButton_Click;
                addButton.Tag    = currentUser;

                usersPanel.Controls.Add(addButton);

                BunifuSeparator separatorLine = new BunifuSeparator();
                separatorLine.LineColor = lineColor;
                separatorLine.Size      = new Size(usersPanel.Width - 2 * topAvatar, 1);
                separatorLine.Location  =
                    new Point(topAvatar, usersPanel.Height - 1);

                usersPanel.Controls.Add(separatorLine);

                AddPanel AddFriendMethod = scrollPanel.Controls.Add;
                scrollPanel.Invoke(AddFriendMethod, usersPanel);
            }
            downloaded = false;

            scrollPanel.ContentAdded = false;
            ResumeLayout();
        }
Пример #12
0
        public AddFriendScreen()
        {
            Color labelColor = Color.Gray;

            double ratio = 1 / 94.0;

            unit = Width * ratio;
            int padding = (int)(unit * 5);

            Width  = (int)(Width * 2.9);
            Height = (int)(Height * 1.5);
            unit  *= 1.5;


            leftPanel           = new Panel();
            leftPanel.BackColor = Color.White;
            leftPanel.Location  = new Point(0, header.Bottom + padding);
            leftPanel.Size      = new Size((int)(38.6 * padding),
                                           Height - header.Height - padding);
            Body.Controls.Add(leftPanel);

            Panel firstPanel = new Panel();

            firstPanel.BackColor = Color.FromArgb(250, 251, 252);
            firstPanel.Size      = new Size(leftPanel.Width, (int)(13.5 * unit));

            leftPanel.Controls.Add(firstPanel);

            Label peopleLable = new Label();

            peopleLable.Text     = "Люди  ";
            peopleLable.Font     = new Font("Tahoma", 10, FontStyle.Bold);
            peopleLable.AutoSize = true;
            peopleLable.Location = new Point(padding, (int)(5 * unit));

            firstPanel.Controls.Add(peopleLable);

            Label countLable = new Label();

            countLable.Text      = "100";
            countLable.AutoSize  = true;
            countLable.Font      = new Font("Tahoma", 11);
            countLable.ForeColor = Color.FromArgb(147, 147, 147);
            countLable.Location  = new Point(peopleLable.Right, peopleLable.Top);

            firstPanel.Controls.Add(countLable);

            BunifuSeparator firstLine = new BunifuSeparator();

            firstLine.LineColor = lineColor;
            firstLine.Height    = 1;
            firstLine.Location  = new Point(0, firstPanel.Height - firstLine.Height);
            firstLine.Width     = leftPanel.Width;
            firstPanel.Controls.Add(firstLine);

            Panel secondPanel = new Panel();

            secondPanel.Size     = new Size(leftPanel.Width, (int)(11.0 * unit));
            secondPanel.Location = new Point(0, firstPanel.Bottom + 1);

            leftPanel.Controls.Add(secondPanel);

            PictureBox searchPicture = new PictureBox();

            searchPicture.Image    = Properties.Resources.search;
            searchPicture.SizeMode = PictureBoxSizeMode.StretchImage;
            searchPicture.Size     = new Size
                                         ((int)(4.8 * unit), (int)(4.8 * unit));
            int topImage = GetLeftPosition(searchPicture.Height, secondPanel.Height);

            searchPicture.Location = new Point(padding, topImage);

            secondPanel.Controls.Add(searchPicture);

            resetPicture          = new PictureBox();
            resetPicture.Visible  = false;
            resetPicture.Image    = Properties.Resources.reset;
            resetPicture.SizeMode = PictureBoxSizeMode.StretchImage;
            resetPicture.Size     = new Size
                                        ((int)(3.5 * unit), (int)(3.5 * unit));
            topImage = GetLeftPosition(resetPicture.Height, secondPanel.Height);
            resetPicture.Location = new Point
                                        (secondPanel.Width - resetPicture.Width - padding, topImage);

            resetPicture.MouseEnter += ResetPicture_MouseEnter;
            resetPicture.MouseLeave += ResetPicture_MouseLeave;
            resetPicture.Click      += ResetPicture_Click;

            secondPanel.Controls.Add(resetPicture);


            textBox             = new TextBox();
            textBox.Font        = chatFont;
            textBox.BorderStyle = BorderStyle.None;
            textBox.Size        = new Size
                                      (secondPanel.Width - resetPicture.Width
                                      - searchPicture.Width - 4 * padding,
                                      secondPanel.Height);
            int textBoxTop = GetLeftPosition(textBox.Height, secondPanel.Height);

            textBox.Location     = new Point(searchPicture.Right + padding, textBoxTop);
            textBox.TextChanged += TextBox_TextChanged;
            textBox.KeyPress    += TextBox_KeyPress;

            shadowLabel          = new Label();
            shadowLabel.Text     = "Начните вводить любое имя";
            shadowLabel.Font     = chatFont;
            shadowLabel.AutoSize = true;
            shadowLabel.Enabled  = false;
            shadowLabel.Location = new Point(textBox.Left + 1, textBox.Top);

            secondPanel.Controls.Add(shadowLabel);
            secondPanel.Controls.Add(textBox);

            BunifuSeparator secondLine = new BunifuSeparator();

            secondLine.LineColor = lineColor;
            secondLine.Height    = 1;
            secondLine.Location  = new Point(0, secondPanel.Height - secondLine.Height);
            secondLine.Width     = leftPanel.Width;
            secondPanel.Controls.Add(secondLine);

            scrollPanel      = new ScrollPanel();
            scrollPanel.Size = new Size(leftPanel.Width - scrollPanel.scrollPadding,
                                        leftPanel.Height - secondPanel.Bottom);
            scrollPanel.Location         = new Point(0, secondPanel.Bottom + 1);
            scrollPanel.requestDownload += ScrollPanel_requestDownload;

            leftPanel.Controls.Add(scrollPanel);

            Panel rightPanel = new Panel();

            rightPanel.BackColor = Color.White;
            rightPanel.Location  = new Point(leftPanel.Right + padding,
                                             leftPanel.Top);
            rightPanel.Size = new Size(Width - rightPanel.Left,
                                       leftPanel.Height);
            Body.Controls.Add(rightPanel);

            int topBegin = (int)(rightPanel.Height / 5.0);

            BunifuSeparator topLine = new BunifuSeparator();

            topLine.LineColor = lineColor;
            topLine.Location  = new Point(padding, topBegin);
            topLine.Width     = rightPanel.Width - 2 * padding;
            rightPanel.Controls.Add(topLine);

            Label ageLabel = new Label();

            ageLabel.Text      = "Возраст";
            ageLabel.Font      = boldChatFont;
            ageLabel.AutoSize  = true;
            ageLabel.ForeColor = labelColor;
            int bottomLastControl =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;

            ageLabel.Location = new Point(padding, bottomLastControl);

            rightPanel.Controls.Add(ageLabel);


            int dropWidth = (int)(rightPanel.Width / 2.5);

            fromAgeDrop = new ComboBox();
            fromAgeDrop.DropDownStyle = ComboBoxStyle.DropDown;
            fromAgeDrop.Width         = dropWidth;
            bottomLastControl         =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;
            fromAgeDrop.Location = new Point(padding, bottomLastControl + padding);
            DropDownComplete(fromAgeDrop, "От", 14, 80);
            fromAgeDrop.SelectedIndexChanged += FromAgeDrop_SelectedIndexChanged;

            rightPanel.Controls.Add(fromAgeDrop);

            Label separatorLabel = new Label();

            separatorLabel.Text     = "-";
            separatorLabel.Font     = boldChatFont;
            separatorLabel.AutoSize = true;
            separatorLabel.Location = new Point
                                          (fromAgeDrop.Right + 1, fromAgeDrop.Top);
            rightPanel.Controls.Add(separatorLabel);

            toAgeDrop               = new ComboBox();
            toAgeDrop.Width         = dropWidth;
            toAgeDrop.DropDownStyle = ComboBoxStyle.DropDown;
            toAgeDrop.Location      = new Point
                                          (separatorLabel.Right + 1, fromAgeDrop.Top);
            DropDownComplete(toAgeDrop, "До", 14, 80);
            toAgeDrop.SelectedIndexChanged += ToAgeDrop_SelectedIndexChanged;

            rightPanel.Controls.Add(toAgeDrop);

            Label genderLabel = new Label();

            genderLabel.Text      = "Пол";
            genderLabel.Font      = boldChatFont;
            genderLabel.AutoSize  = true;
            genderLabel.ForeColor = labelColor;
            bottomLastControl     =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;


            rightPanel.Controls.Add(genderLabel);

            genderLabel.Location = new Point(padding,
                                             bottomLastControl + toAgeDrop.Margin.Bottom + padding);

            genderLabel.Margin = new Padding(3);

            RadioButton female = new RadioButton();

            female.Font       = chatFont;
            female.Text       = "Женский";
            bottomLastControl =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;
            female.Location = new Point(padding, bottomLastControl + padding);

            rightPanel.Controls.Add(female);

            RadioButton male = new RadioButton();

            male.Font         = chatFont;
            male.Text         = "Мужской";
            bottomLastControl =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;
            male.Location = new Point(padding, bottomLastControl);

            rightPanel.Controls.Add(male);

            RadioButton any = new RadioButton();

            any.Font          = chatFont;
            any.Text          = "Любой";
            bottomLastControl =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;
            any.Location = new Point(padding, bottomLastControl);

            rightPanel.Controls.Add(any);

            BunifuSeparator middleLine = new BunifuSeparator();

            middleLine.LineColor = lineColor;
            bottomLastControl    =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;
            middleLine.Location = new Point(padding, bottomLastControl);
            middleLine.Width    = rightPanel.Width - 2 * padding;
            rightPanel.Controls.Add(middleLine);

            CheckBox fotoCheckBox = new CheckBox();

            fotoCheckBox.Text     = "с фотографией";
            fotoCheckBox.Font     = chatFont;
            fotoCheckBox.AutoSize = true;
            bottomLastControl     =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;
            fotoCheckBox.Location = new Point(padding, bottomLastControl);
            rightPanel.Controls.Add(fotoCheckBox);

            CheckBox onlineCheckBox = new CheckBox();

            onlineCheckBox.Text     = "сейчас на сайте";
            onlineCheckBox.Font     = chatFont;
            onlineCheckBox.AutoSize = true;
            bottomLastControl       =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;
            onlineCheckBox.Location = new Point(padding, bottomLastControl + padding);
            rightPanel.Controls.Add(onlineCheckBox);

            BunifuSeparator bottomLine = new BunifuSeparator();

            bottomLine.LineColor = lineColor;
            bottomLastControl    =
                rightPanel.Controls[rightPanel.Controls.Count - 1].Bottom;
            bottomLine.Location = new Point(padding, bottomLastControl);
            bottomLine.Width    = rightPanel.Width - 2 * padding;
            rightPanel.Controls.Add(bottomLine);

            ClientSocketHandler.SendToServer("Select 0");
        }
Пример #13
0
        private void loadItems()
        {
            MySqlConnection con = new MySqlConnection();

            con.ConnectionString = login.dbConnection;

            string       load = "select item_id,item_name,status from sentitems where receiver_email = '" + login.user_email + "' order by item_id DESC";
            MySqlCommand com  = new MySqlCommand(load, con);

            DataTable       table = new DataTable();
            MySqlDataReader reader;

            try
            {
                con.Open();
                reader = com.ExecuteReader();
                table.Load(reader);
                reader.Close();
                count = table.Rows.Count;
                if (count == 0)
                {
                    //a lable to hold the name of the item
                    Label item = new Label();
                    item           = new Label();
                    item.AutoSize  = true;
                    item.ForeColor = Color.FromArgb(235, 60, 0);
                    item.Font      = new Font("Cambria", 15, FontStyle.Bold);
                    item.Text      = "Sorry, You Have No Items To View -:)";

                    //seperator for the emails
                    BunifuSeparator spr = new BunifuSeparator();
                    spr.LineThickness = 2;
                    spr.Height        = 1;
                    spr.Anchor        = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
                    spr.LineColor     = Color.FromArgb(0, 122, 204);
                    spr.Transparency  = 50;

                    //a panel to catch the rows
                    FlowLayoutPanel fly = new FlowLayoutPanel();
                    fly.Height        = 40;
                    fly.Width         = 850;
                    fly.AutoSize      = true;
                    fly.FlowDirection = FlowDirection.LeftToRight;
                    fly.WrapContents  = false;

                    //adding the controls to the dynamic panel
                    fly.Controls.Add(item);

                    //adding the pannel to the mother flowpanel
                    flowLayoutPanel1.Controls.Add(fly);
                    flowLayoutPanel1.Controls.Add(spr);
                }
                else
                {
                    reader = com.ExecuteReader();
                    while (reader.Read())
                    {
                        //taking the item id
                        string item_id = reader.GetString("item_id");
                        //taking th enam of the item
                        string item_name = reader.GetString("item_name");
                        //checking the status of the item
                        string status = reader.GetString("status");

                        //checking if the item is new(never opened)
                        if (status == "New")
                        {
                            //creating a sign to show the item is new
                            Label sign = new Label();
                            sign.Text      = "New";
                            sign.Font      = new Font("Cambria", 8, FontStyle.Bold);
                            sign.ForeColor = Color.DarkGreen;

                            //a lable to hold the name of the item
                            Label item = new Label();
                            item           = new Label();
                            item.Name      = item_id;
                            item.Width     = 500;
                            item.ForeColor = Color.FromArgb(30, 0, 40);
                            item.Font      = new Font("Cambria", 12, FontStyle.Bold);
                            item.Text      = item_name;

                            //creating the butto to download the item
                            // Download Button
                            BunifuFlatButton bt = new BunifuFlatButton();
                            bt.Name   = item_id;
                            bt.Text   = "Download";
                            bt.Height = 30;
                            bt.Width  = 120;

                            bt.Normalcolor  = Color.FromArgb(0, 122, 204);
                            bt.OnHovercolor = Color.FromArgb(32, 9, 191);
                            bt.Activecolor  = Color.FromArgb(0, 122, 204);
                            bt.Iconimage    = null;
                            bt.TextAlign    = ContentAlignment.MiddleCenter;
                            bt.BorderRadius = 5;
                            bt.Click       += new EventHandler(downloadBtn_Click);

                            // Delete Button
                            BunifuFlatButton bt1 = new BunifuFlatButton();
                            bt1.Name         = item_id;
                            bt1.Text         = "Delete";
                            bt1.Height       = 30;
                            bt1.Width        = 120;
                            bt1.Normalcolor  = Color.FromArgb(0, 122, 204);
                            bt1.OnHovercolor = Color.FromArgb(32, 9, 191);
                            bt1.Activecolor  = Color.FromArgb(0, 122, 204);
                            bt1.Iconimage    = null;
                            bt1.TextAlign    = ContentAlignment.MiddleCenter;
                            bt1.BorderRadius = 5;
                            bt1.Click       += new EventHandler(deletebtn_Click);

                            //seperator for the emails
                            BunifuSeparator spr = new BunifuSeparator();
                            spr.LineThickness = 2;
                            spr.Height        = 1;
                            spr.Anchor        = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
                            spr.LineColor     = Color.FromArgb(235, 60, 0);
                            spr.Transparency  = 50;

                            //a panel to catch the rows
                            FlowLayoutPanel fly = new FlowLayoutPanel();
                            fly.Height        = 40;
                            fly.Width         = 850;
                            fly.AutoSize      = true;
                            fly.FlowDirection = FlowDirection.LeftToRight;
                            fly.WrapContents  = false;

                            //adding the controls to the dynamic panel
                            fly.Controls.Add(sign);
                            fly.Controls.Add(item);
                            fly.Controls.Add(bt);
                            fly.Controls.Add(bt1);

                            //adding the pannel to the mother flowpanel
                            flowLayoutPanel1.Controls.Add(fly);
                            flowLayoutPanel1.Controls.Add(spr);
                        }
                        else
                        {
                            //creating a sign to show the item is new
                            Label sign = new Label();
                            sign.Text      = "√";
                            sign.Font      = new Font("Cambria", 9, FontStyle.Bold);
                            sign.ForeColor = Color.FromArgb(235, 60, 0);
                            //a lable to hold the name of the item
                            Label item = new Label();
                            item           = new Label();
                            item.Name      = item_id;
                            item.Width     = 500;
                            item.ForeColor = Color.FromArgb(129, 129, 131);
                            item.Font      = new Font("Cambria", 12, FontStyle.Regular);
                            item.Text      = item_name;

                            //creating the butto to download the item
                            //Button
                            BunifuFlatButton bt = new BunifuFlatButton();
                            bt.Name   = item_id;
                            bt.Text   = "View";
                            bt.Height = 30;
                            bt.Width  = 120;

                            bt.Normalcolor  = Color.DarkGray;
                            bt.OnHovercolor = Color.DimGray;
                            bt.Activecolor  = Color.DarkGray;
                            bt.Iconimage    = null;
                            bt.TextAlign    = ContentAlignment.MiddleCenter;
                            bt.BorderRadius = 5;
                            bt.Click       += new EventHandler(viewBtn_Click);

                            // Delete Button
                            BunifuFlatButton bt1 = new BunifuFlatButton();
                            bt1.Name         = item_id;
                            bt1.Text         = "Delete";
                            bt1.Height       = 30;
                            bt1.Width        = 120;
                            bt1.Normalcolor  = Color.DarkGray;
                            bt1.OnHovercolor = Color.DimGray;
                            bt1.Activecolor  = Color.DarkGray;
                            bt1.Iconimage    = null;
                            bt1.TextAlign    = ContentAlignment.MiddleCenter;
                            bt1.BorderRadius = 5;
                            bt1.Click       += new EventHandler(deletebtn_Click);

                            //Redownload Button
                            BunifuFlatButton bt2 = new BunifuFlatButton();
                            bt2.Name   = item_id;
                            bt2.Text   = "Re-Download";
                            bt2.Height = 30;
                            bt2.Width  = 120;

                            bt2.Normalcolor  = Color.DarkGray;
                            bt2.OnHovercolor = Color.DimGray;
                            bt2.Activecolor  = Color.DarkGray;
                            bt2.Iconimage    = null;
                            bt2.TextAlign    = ContentAlignment.MiddleCenter;
                            bt2.BorderRadius = 5;
                            bt2.Click       += new EventHandler(downloadBtn_Click);

                            //seperator for the emails
                            BunifuSeparator spr = new BunifuSeparator();
                            spr.LineThickness = 2;
                            spr.Height        = 1;
                            spr.Anchor        = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
                            spr.LineColor     = Color.FromArgb(235, 60, 0);
                            spr.Transparency  = 50;


                            //a panel to catch the rows
                            FlowLayoutPanel fly = new FlowLayoutPanel();
                            fly.Height        = 40;
                            fly.Width         = 850;
                            fly.AutoSize      = true;
                            fly.FlowDirection = FlowDirection.LeftToRight;
                            fly.WrapContents  = false;

                            //adding the controls to the dynamic panel
                            fly.Controls.Add(sign);
                            fly.Controls.Add(item);
                            fly.Controls.Add(bt);
                            fly.Controls.Add(bt1);
                            fly.Controls.Add(bt2);

                            //adding the pannel to the mother flowpanel
                            flowLayoutPanel1.Controls.Add(fly);
                            flowLayoutPanel1.Controls.Add(spr);
                        }
                    }
                }
                reader.Close();
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            con.Close();
        }
Пример #14
0
        public void SearchField_KeyUp(object sender, KeyEventArgs e)
        {
            while (Controls.Count > 1)
            {
                Control cnt = Controls[Controls.Count - 1];
                if (cnt.Name != "Panel")
                {
                    Controls.Remove(cnt);
                }
            }
            string find_string = SearchField.Text.ToUpper();

            if (find_string != "")
            {
                List <Projects> Find_projects =
                    connection.Projects.ToList().Where(l => l.PrjtName.ToUpper().Contains(find_string)).ToList();
                if (Find_projects.Any())
                {
                    var thinButtonY  = 345;
                    var pictureBoxY  = 95;
                    var separatorY   = 345;
                    var customLabelY = 420;
                    var likeButtonY  = 405;
                    foreach (var project in Find_projects)
                    {
                        BunifuThinButton2 thinButton = new BunifuThinButton2 {
                            Name = "thinButton" + project.PrjtId
                        };
                        thinButton.ButtonText         = project.PrjtName;
                        thinButton.Size               = new Size(655, 55);
                        thinButton.IdleLineColor      = Color.White;
                        thinButton.IdleCornerRadius   = 1;
                        thinButton.IdleForecolor      = Color.Black;
                        thinButton.ActiveCornerRadius = 1;
                        thinButton.ActiveFillColor    = Color.White;
                        thinButton.ActiveLineColor    = Color.Black;
                        thinButton.ActiveForecolor    = Color.FromArgb(12, 185, 102);
                        thinButton.TextAlign          = ContentAlignment.MiddleLeft;
                        thinButton.Location           = new Point(50, thinButtonY);
                        thinButton.Tag    = (object)project;
                        thinButtonY      += 400;
                        thinButton.Click += GetProfileInfo;
                        thinButton.Font   = new Font("Century Gothic", 12);

                        PictureBox pictureBox = new PictureBox();
                        pictureBox.SizeMode = PictureBoxSizeMode.CenterImage;
                        pictureBox.Size     = new Size(450, 250);
                        pictureBox.Location = new Point(150, pictureBoxY);
                        if (File.Exists(@"Pictures\" + project.PrjtImagePath))
                        {
                            pictureBox.Image = new Bitmap(@"Pictures\" + project.PrjtImagePath);
                        }
                        else
                        {
                            pictureBox.Image = new Bitmap(@"Pictures\default.jpg");
                        }
                        pictureBoxY += 400;

                        BunifuSeparator separator = new BunifuSeparator();
                        separator.Size          = new Size(655, 15);
                        separator.LineColor     = Color.FromArgb(12, 185, 102);
                        separator.LineThickness = 3;
                        separator.Location      = new Point(50, separatorY);
                        separatorY += 400;

                        BunifuCustomLabel customLabel = new BunifuCustomLabel();
                        customLabel.Font     = new Font("Century Gothic", 12);
                        customLabel.Text     = "Likes: " + project.PjrtLikeCounter;
                        customLabel.Location = new Point(50, customLabelY);
                        customLabelY        += 400;

                        BunifuImageButton likeButton = new BunifuImageButton()
                        {
                            Name = "imageButton" + project.PrjtId
                        };
                        likeButton.Zoom      = 15;
                        likeButton.Size      = new Size(30, 30);
                        likeButton.BackColor = Color.Transparent;
                        likeButton.SizeMode  = PictureBoxSizeMode.StretchImage;
                        likeButton.Image     = NotLikedProject.Image;
                        likeButton.Location  = new Point(675, likeButtonY);
                        likeButtonY         += 400;
                        likeButton.Click    += new EventHandler(Like_project);

                        Controls.Add(thinButton);
                        Controls.Add(pictureBox);
                        Controls.Add(separator);
                        Controls.Add(customLabel);
                        Controls.Add(likeButton);
                    }
                }
                else
                {
                    BunifuCustomLabel label = new BunifuCustomLabel();
                    label.Text     = "Cannot find matches...";
                    label.AutoSize = true;
                    label.Location = new Point(50, 95);
                }
            }
        }