private void digitButton_click(object sender, EventArgs e)
        {
            txtNewPrice.Focus();
            BunifuButton btn = (BunifuButton)sender;

            SendKeys.Send(btn.Text);
        }
Beispiel #2
0
        private void btnBusqueda_Click(object sender, EventArgs e)
        {
            BunifuButton bunifuButton =
                new BunifuButton();

            bunifuButton.Location   = new System.Drawing.Point(70, 70);
            bunifuButton.ButtonText = "Hello world";

            bunifuButton.Click += (senderObject, eventArgs) => {
                MessageBox.Show("Hello there...");
            };

            Controls.Add(bunifuButton);

            if (filterFac.Text.Trim() == "")
            {
                MessageBox.Show("No escrito nada en el filtro, por favor verifique");
            }
            else
            {
                DataTable table = new DataTable();
                table = _sevice.FindTable(filterFac.Text.Trim());

                gridHistorico.DataSource = table;
            }
        }
Beispiel #3
0
 private void digitButton_click(object sender, EventArgs e)
 {
     if (textBox != null)
     {
         textBox.Focus();
         BunifuButton btn = (BunifuButton)sender;
         SendKeys.Send(btn.Text);
     }
 }
        private void btnNormal_Click(object sender, EventArgs e)
        {
            BunifuButton btn = (BunifuButton)sender;

            if (changePrice)
            {
                txtNewPrice.Text = defultPrice;
            }
            else
            {
                txtNewPrice.Text = "";
            }
        }
 private void ActivateButton(object senderButton)
 {
     if (senderButton != null)
     {
         //Button
         DisableButton();
         currButton      = (BunifuButton)senderButton;
         currButton.Font = new System.Drawing.Font("Roboto Medium", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
         //Border Button
         bottomBorderBtn.Location = new Point(currButton.Location.X, 49);
         bottomBorderBtn.Visible  = true;
         bottomBorderBtn.BringToFront();
     }
 }
        private void common_button_click(object sender, EventArgs e)
        {
            BunifuButton b = (BunifuButton)sender;

            using (SqlConnection sqlCon = new SqlConnection(connectionString))
            {
                sqlCon.Open();
                SqlDataAdapter getCategory =
                    new SqlDataAdapter("SELECT f.Id, f.commonName, f.commonOtherName, f.price FROM FoodCommon f " +
                                       "LEFT JOIN CommonCategory c ON f.category = c.Id WHERE c.commonCategory = '" + b.Text + "'", sqlCon);
                DataSet categoryDataSet = new DataSet();
                getCategory.Fill(categoryDataSet);
                sqlCon.Close();
                btnLogout.DataSource = categoryDataSet.Tables[0];
            }
        }
Beispiel #7
0
 public void keyboard_click(object sender, EventArgs e)
 {
     if (activedTextbox != null)
     {
         BunifuButton btn = (BunifuButton)sender;
         activedTextbox.Focus();
         if (shiftPressed)
         {
             SendKeys.Send('+' + btn.Text);
             press_shift();
         }
         else
         {
             SendKeys.Send(btn.Text);
         }
     }
 }
Beispiel #8
0
        public void press_shift()
        {
            shiftPressed = !shiftPressed;

            BunifuButton leftShiftButton  = (BunifuButton)leftShift;
            BunifuButton rightShiftButton = (BunifuButton)rightShift;

            if (shiftPressed)
            {
                leftShiftButton.IdleBorderThickness  = 5;
                rightShiftButton.IdleBorderThickness = 5;
            }
            else
            {
                leftShiftButton.IdleBorderThickness  = 1;
                rightShiftButton.IdleBorderThickness = 1;
            }
        }
Beispiel #9
0
 public void press_capsLock(object sender, EventArgs e)
 {
     if (activedTextbox != null)
     {
         activedTextbox.Focus();
         SendKeys.Send("{CAPSLOCK}");
         capsPressed = !capsPressed;
         BunifuButton capsLock = (BunifuButton)sender;
         if (capsPressed)
         {
             capsLock.IdleBorderThickness = 5;
         }
         else
         {
             capsLock.IdleBorderThickness = 1;
         }
     }
 }
        private void dishButton_click(object sender, EventArgs e)
        {
            BunifuButton b = (BunifuButton)sender;

            using (SqlConnection sqlCon = new SqlConnection(connectionString))
            {
                sqlCon.Open();
                SqlDataAdapter getCategory =
                    new SqlDataAdapter("SELECT f.Id, f.foodName, f.foodOtherName, f.price FROM FoodMenu f " +
                                       "LEFT JOIN FoodCategory c ON f.category1 = c.Id " +
                                       "LEFT JOIN FoodCategory c2 ON f.category2 = c2.Id" +
                                       " WHERE c.categoryName = '" + b.Text + "' OR c2.categoryName = '" + b.Text + "'", sqlCon);
                DataSet categoryDataSet = new DataSet();
                getCategory.Fill(categoryDataSet);
                sqlCon.Close();
                dgvFood.DataSource = categoryDataSet.Tables[0];
            }
        }
Beispiel #11
0
 public void ActivateButton(object senderBtn, Color color)
 {
     if (senderBtn != null)
     {
         DisableButton();
         //Button
         currentBtn = (BunifuButton)senderBtn;
         //currentBtn.TextAlign = ContentAlignment.MiddleCenter;
         //currentBtn.BackColor1 = Color.FromArgb(40, 96, 144);
         //currentBtn.IdleFillColor = Color.FromArgb(40, 96, 144);
         //Left border button
         leftBorderBtn.BackColor = color;
         leftBorderBtn.Location  = new Point(0, currentBtn.Location.Y);
         leftBorderBtn.Size      = new Size(7, currentBtn.Size.Height);
         leftBorderBtn.Visible   = true;
         leftBorderBtn.BringToFront();
         //Current Child Form Icon
     }
 }
        public FrmMain(string username, string role)
        {
            string workingDriectory = Environment.CurrentDirectory;
            string projectDrictory  = Directory.GetParent(workingDriectory).Parent.FullName;

            connectionString = "Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=" + projectDrictory + "\\PointOfSaleLocalDatabase.mdf;Integrated Security=True";

            InitializeComponent();

            using (SqlConnection sqlCon = new SqlConnection(connectionString))
            {
                sqlCon.Open();
                SqlCommand addCustomer = new SqlCommand("SELECT categoryName, buttonColor FROM FoodCategory", sqlCon);
                addCustomer.CommandType = CommandType.Text;

                using (SqlDataReader reader = addCustomer.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        BunifuButton b = new BunifuButton();
                        b.Text          = reader["categoryName"].ToString();
                        b.IdleFillColor = Color.FromArgb(Convert.ToInt32(reader["buttonColor"]));
                        b.Size          = new Size(200, 90);
                        b.Click        += dishButton_click;
                        flpDishMenu.Controls.Add(b);
                    }
                }

                SqlCommand getCommonCategory = new SqlCommand("SELECT commonCategory, buttonColor FROM CommonCategory", sqlCon);
                getCommonCategory.CommandType = CommandType.Text;

                using (SqlDataReader reader = getCommonCategory.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        BunifuButton b = new BunifuButton();
                        b.Text          = reader["commonCategory"].ToString();
                        b.IdleFillColor = Color.FromArgb(Convert.ToInt32(reader["buttonColor"]));
                        b.Size          = new Size(110, 50);
                        b.Click        += common_button_click;
                        flpCommonCategory.Controls.Add(b);
                    }
                }

                sqlCon.Close();
            }

            delete.Text          = "Delete";
            delete.Size          = new Size(110, 50);
            delete.IdleFillColor = Color.Crimson;
            delete.Click        += deleteCommon_click;
            flpCommonCategory.Controls.Add(delete);

            lblUsername.Text = username;
            lblRole.Text     = role;
            lblDate.Text     = DateTime.Now.Date.ToString("yyyy-M-d dddd");

            lblHouseNo.Text     = "";
            lblAddress.Text     = "";
            lblDeliverTime.Text = "";
            lblTelphone.Text    = "";
            lblDeliverFee.Text  = "1";
            lblPostcode.Text    = "";
            lblName.Text        = "";
            lblTotal.Text       = "0.00";
            lblNote.Text        = "";

            dgvFood.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
        }
Beispiel #13
0
        private void bunifuButton_Click(object sender, EventArgs e)
        {
            BunifuButton b = (BunifuButton)sender;

            switch (b.Name)
            {
            case "btn_GradientSignIn": bunifuPages1.SetPage(0);

                break;

            case "btn_GradientSignUp": bunifuPages1.SetPage(1);
                break;

            case "btn_SignIn": if (crud.SignInVerification(this))
                {
                    CurrentUserId = crud.getCurrentUserId(txt_SignInEmail.Text);
                    Form2 f2 = new Form2(CurrentUserId);
                    f2.Show();
                    this.Hide();
                }
                break;

            case "btn_Continue": if (crud.ContinueBtnVerification(this))
                {
                    bunifuPages1.SetPage(2);
                    txt_UserFName.Text = FirstName;
                    txt_UserLName.Text = LastName;
                }
                break;

            case "btn_Back1": bunifuPages1.SetPage(1);
                break;

            case "btn_Back2": bunifuPages1.SetPage(2);
                break;

            case "btn_Back3": if (isDivorced)
                {
                    bunifuPages1.SetPage(2);
                }
                else
                {
                    bunifuPages1.SetPage(3);
                }
                break;

            case "btn_Back4": if (txt_ChN.Visible || isDivorcedAndHasChildren)
                {
                    bunifuPages1.SetPage(4);
                }
                else
                {
                    bunifuPages1.SetPage(3);
                }
                break;

            case "btn_SignUp2": if (crud.ParentsVerification(this))
                {
                    crud.InsertUser(this);
                    CurrentUserId = crud.getCurrentUserId(txt_SignUpEmail.Text);
                    if (!String.IsNullOrWhiteSpace(txt_SpouseFName.Text))
                    {
                        crud.InsertSpouse(this);
                    }
                    if (Children.Count > 0)
                    {
                        crud.InsertChildren(this);
                    }
                    crud.InsertParents(this);
                    bunifuPages1.SetPage(0);
                }
                break;

            default: break;
            }
        }