Ejemplo n.º 1
0
 private void loginBtn_Click(object sender, EventArgs e)
 {
     if (MainClass.checkControls(leftpanel).Count == 0)
     {
         if (retrival.getUserDetails(usrTxt.Text, passTxt.Text))
         {
             if (retrival.ROLE == "Administrator")
             {
                 HomeScreen obj = new HomeScreen();
                 MainClass.showWindow(obj, this, MDI.ActiveForm);
             }
             else if (retrival.ROLE == "Chef")
             {
                 HomeScreen2 obj = new HomeScreen2();
                 MainClass.showWindow(obj, this, MDI.ActiveForm);
             }
         }
         else
         {
         }
     }
 }
Ejemplo n.º 2
0
 public override void saveBtn_Click(object sender, EventArgs e)
 {
     if (MainClass.checkControls(leftpanel).Count == 0)
     {
         if (edit == 0)//save code
         {
             insertions.insertTax(CB.SelectedItem.ToString(), Convert.ToSingle(taxTxt.Text));
             MainClass.disable_reset(leftpanel);
             retrival.showTax(dataGridView1, taxIDGV, taxtGV, taxvGV);
         }
         else if (edit == 1)// update code
         {
             updation.updateTax(taxID, Convert.ToSingle(taxTxt.Text), CB.SelectedItem.ToString());
             MainClass.disable_reset(leftpanel);
             retrival.showTax(dataGridView1, taxIDGV, taxtGV, taxvGV);
         }
     }
     else
     {
         MessageBox.Show("Please Enter all require Feilds");
     }
 }
Ejemplo n.º 3
0
 public override void saveBtn_Click(object sender, EventArgs e)
 {
     if (MainClass.checkControls(leftpanel).Count == 0)
     {
         if (edit == 0)//save code
         {
             // i.insertUsers(nameTxt.Text,userTxt.Text,phoneTxt.Text,addressTxt.Text,passTxt.Text,Convert.ToInt16(roleCB.SelectedValue.ToString()));
             i.insertUsers(nameTxt.Text, userTxt.Text, phoneTxt.Text, addressTxt.Text, passTxt.Text, Convert.ToInt16(roleCB.SelectedIndex.ToString()));
             MainClass.disable_reset(leftpanel);
             r.showUsers(dataGridView1, userIDGV, nameGV, usernameGV, passGV, phoneGV, addressGV, rolesIDGV, rolesGV);
         }
         else if (edit == 1)// update code
         {
             u.updateUsers(userID, nameTxt.Text, userTxt.Text, phoneTxt.Text, addressTxt.Text, passTxt.Text, Convert.ToInt16(roleCB.SelectedIndex.ToString()));
             MainClass.disable_reset(leftpanel);
             r.showUsers(dataGridView1, userIDGV, nameGV, usernameGV, passGV, phoneGV, addressGV, rolesIDGV, rolesGV);
         }
     }
     else
     {
         MessageBox.Show("Please Enter all require Feilds");
     }
 }
Ejemplo n.º 4
0
 public override void saveBtn_Click(object sender, EventArgs e)
 {
     if (MainClass.checkControls(leftpanel).Count == 0)
     {
         if (edit == 0)//save code
         {
             // i.insertUsers(nameTxt.Text,userTxt.Text,phoneTxt.Text,addressTxt.Text,passTxt.Text,Convert.ToInt16(roleCB.SelectedValue.ToString()));
             i.insertTables(Convert.ToInt32(comboBox1.SelectedItem.ToString()), Convert.ToInt16(NOchairCB.SelectedItem.ToString()), Convert.ToInt16(FloorCB.SelectedValue.ToString()));
             MainClass.disable_reset(leftpanel);
             r.showTables(dataGridView1, tablenumGV, nameGV, floorIDGV, tableidGV, ChairsGV);
         }
         else if (edit == 1)// update code
         {
             u.updateTables(TabelID, Convert.ToInt32(comboBox1.SelectedItem.ToString()), Convert.ToInt16(NOchairCB.SelectedItem.ToString()), Convert.ToInt16(FloorCB.SelectedValue.ToString()));
             MainClass.disable_reset(leftpanel);
             r.showTables(dataGridView1, tablenumGV, nameGV, floorIDGV, tableidGV, ChairsGV);
         }
     }
     else
     {
         MessageBox.Show("Please Enter all require Feilds");
     }
 }
        private void cartBtn_Click(object sender, EventArgs e)
        {
            if (MainClass.checkControls(leftpanel).Count != 0)
            {
                MainClass.showMessage("Feilds with red marks are manadotory", "Error", "Error");
            }
            else
            {
                bool check = false;
                foreach (DataGridViewRow row in dataGridView1.Rows)
                {
                    if (row.Cells["ItemIDGV"].Value.ToString() == itemCB.SelectedValue.ToString())

                    {
                        check = true;
                        break;
                    }
                }

                DataRowView drvItem = itemCB.SelectedItem as DataRowView;

                float totAmon = 0;
                if (check)
                {
                    MainClass.showMessage("Item already exist", "Error", "Error");
                }
                else
                {
                    totAmon += Convert.ToSingle(priceTxt.Text) * Convert.ToSingle(quantiNum.Value);
                    txt.Text = totAmon.ToString();
                    DataRowView drv  = orderIDCB.SelectedItem as DataRowView;
                    DataRowView drv2 = itemCB.SelectedItem as DataRowView;
                    dataGridView1.Rows.Add(null, Convert.ToInt64(drv[0].ToString()), Convert.ToInt64(itemCB.SelectedValue.ToString()), drv2[1].ToString(), Convert.ToDouble(priceTxt.Text), quantiNum.Value, Convert.ToDouble(priceTxt.Text) * Convert.ToInt32(quantiNum.Value));
                }
            }
        }
Ejemplo n.º 6
0
 public override void saveBtn_Click(object sender, EventArgs e)
 {
     if (MainClass.checkControls(leftpanel).Count == 0)
     {
         short status = statusCB.SelectedItem.ToString() == "Avalible" ? Convert.ToInt16(1) : Convert.ToInt16(0);
         if (edit == 0)//save code
         {
             // i.insertUsers(nameTxt.Text,userTxt.Text,phoneTxt.Text,addressTxt.Text,passTxt.Text,Convert.ToInt16(roleCB.SelectedValue.ToString()));
             i.insertMenu(menuTxt.Text, Convert.ToSingle(priceTxt.Text), Convert.ToInt32(categoryCB.SelectedValue.ToString()), status, pictureBox1.Image);
             MainClass.disable_reset(leftpanel);
             r.showMenu(dataGridView1, menuIDgv, MenuItemGV, priceGV, statusGV, catIDGV, CatnameGV);
         }
         else if (edit == 1)// update code
         {
             u.updateMenu(menuID, menuTxt.Text, Convert.ToSingle(priceTxt.Text), Convert.ToInt32(categoryCB.SelectedValue.ToString()), status, pictureBox1.Image);
             MainClass.disable_reset(leftpanel);
             r.showMenu(dataGridView1, menuIDgv, MenuItemGV, priceGV, statusGV, catIDGV, CatnameGV);
         }
     }
     else
     {
         MessageBox.Show("Please Enter all require Feilds");
     }
 }
Ejemplo n.º 7
0
        private void cartBtn_Click(object sender, EventArgs e)
        {
            if (MainClass.checkControls(leftpanel).Count != 0)
            {
                MainClass.showMessage("Feilds with red marks are manadotory", "Error", "Error");
            }
            else
            {
                bool check = false;
                foreach (DataGridViewRow row in dataGridView1.Rows)
                {
                    if (row.Cells["ItemIDGV"].Value.ToString() == itemCB.SelectedValue.ToString())

                    {
                        check = true;
                        break;
                    }
                }
                DataRowView drvFloor = floorCB.SelectedItem as DataRowView;
                DataRowView drvTable = tableCB.SelectedItem as DataRowView;
                DataRowView drvItem  = itemCB.SelectedItem as DataRowView;


                if (check)
                {
                    MainClass.showMessage("Item already exist", "Error", "Error");
                }
                else
                {
                    catID   = retrival.CategoryID;
                    catName = retrival.CatName;
                    if (orderTypeCB.SelectedIndex == 0)
                    {
                        totAmon += Convert.ToSingle(priceTxt.Text) * Convert.ToSingle(quantiNum.Value);
                        txt.Text = totAmon.ToString();

                        dataGridView1.Rows.Add(null, Convert.ToInt32(tableCB.SelectedValue.ToString()),
                                               Convert.ToInt32(floorCB.SelectedValue.ToString()),
                                               catID, catName,
                                               Convert.ToInt32(itemCB.SelectedValue.ToString()),
                                               drvItem["Menu Item"],
                                               Convert.ToSingle(priceTxt.Text),
                                               Convert.ToInt32(quantiNum.Text),
                                               Convert.ToSingle(priceTxt.Text) * Convert.ToInt32(quantiNum.Text),
                                               orderTypeCB.SelectedItem.ToString(),
                                               drvFloor["Floor"],
                                               drvTable["Table Number"],
                                               null);
                    }
                    else if (orderTypeCB.SelectedIndex == 1 || orderTypeCB.SelectedIndex == 2)
                    {
                        totAmon += Convert.ToSingle(priceTxt.Text) * Convert.ToSingle(quantiNum.Value);
                        txt.Text = totAmon.ToString();

                        dataGridView1.Rows.Add(null, null,
                                               null,
                                               catID, catName,
                                               Convert.ToInt32(itemCB.SelectedValue.ToString()),
                                               drvItem["Menu Item"],
                                               Convert.ToSingle(priceTxt.Text),
                                               Convert.ToInt32(quantiNum.Text),
                                               Convert.ToSingle(priceTxt.Text) * Convert.ToInt32(quantiNum.Text),
                                               orderTypeCB.SelectedItem.ToString(),
                                               null,
                                               null,
                                               phoneTxt.Text);
                    }
                }
            }

            MainClass.sno(dataGridView1, "snoGV");
        }