Exemplo n.º 1
0
        private void cbbCategory_Click(object sender, EventArgs e)
        {
            DataTable dt = AdminSettingController.Category_Show().Tables[0];

            cbbCategory.Items.Clear();
            foreach (DataRow dr in dt.Rows)
            {
                string temp = dr["CategoryName"].ToString();
                cbbCategory.Items.Add(temp);
            }
        }
Exemplo n.º 2
0
        private void btnProductCategory_Click(object sender, EventArgs e)
        {
            int ybtn = 4;

            if (flaqMenuCategory == true)
            {
                this.pnCategory.Visible = true;
                flaqMenuCategory        = false;
            }
            else
            {
                this.pnCategory.Visible = false;
                this.pnPanel.Visible    = false;
                flaqMenuCategory        = true;
            }
            DataTable dtCategory = AdminSettingController.Category_Show().Tables[0];
            int       count      = 0;

            foreach (DataRow dr in dtCategory.Rows)
            {
                Guna.UI.WinForms.GunaButton btnCategory = new Guna.UI.WinForms.GunaButton();
                btnCategory.Location         = new Point(3, ybtn);
                btnCategory.Size             = new Size(215, 35);
                btnCategory.Animated         = true;
                btnCategory.BackColor        = Color.Transparent;
                btnCategory.BaseColor        = Color.Silver;
                btnCategory.BorderColor      = Color.Black;
                btnCategory.ForeColor        = Color.Black;
                btnCategory.BorderSize       = 1;
                btnCategory.Cursor           = Cursors.Hand;
                btnCategory.Font             = new Font("Tahoma", 13, FontStyle.Bold);
                btnCategory.Image            = null;
                btnCategory.OnHoverBaseColor = Color.DarkGray;
                btnCategory.Radius           = 5;
                btnCategory.TextAlign        = HorizontalAlignment.Center;
                btnCategory.Text             = dr["CategoryName"].ToString();
                btnCategory.Click           += BtnCategory_Click;
                btnCategory.DoubleClick     += BtnCategory_DoubleClick;
                ybtn += 34;
                pnCategory.Controls.Add(btnCategory);
                count++;
            }
            pnCategory.Height = 36 * count;
        }