Exemple #1
0
        private void Button3_Click(object sender, System.EventArgs e)
        {
            cnnt sc = new cnnt();

            sc.insqry = ("UPDATE `pricetbl` SET `Price_Of_One`= \'" + (txtupd.Text + ("\' WHERE `Item_Id`= \'" + (txtitm.Text + "\'"))));
            sc.cnntotbl();
        }
Exemple #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            cnnt sc = new cnnt();

            sc.insqry = ("UPDATE `insert` SET " + (quantity.Text + ("= \'" + (unitPrice.Text + ("\' WHERE `productID`= \'" + (productID.Text + "\'"))))));
            sc.cnntotbl();
        }
Exemple #3
0
        private void Button5_Click(object sender, System.EventArgs e)
        {
            try
            {
                string ty;
                if (rb0.Checked)
                {
                    ty = "1";
                }

                if (rbadmin.Checked)
                {
                    ty = "0";
                }

                cnnt sc = new cnnt();
                sc.insqry = ("INSERT INTO `logtbl`(`Id`, `Paswrd`, `type`) VALUES (\'" + (txtitm.Text + ("\',\'" + (txtupd.Text + "\',\'1\')"))));
                sc.cnntotbl();
                MessageBox.Show("New user created successfully");
                try
                {
                    System.IO.FileStream file;
                    System.IO.File.Copy(path, (txtitm.Text + ".jpg"));
                    //file.Close();
                }
                catch (Exception ex)
                {
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(("ErrorToString creating user " + ex.Message));
            }
        }
Exemple #4
0
        private void Button2_Click(object sender, System.EventArgs e)
        {
            cnnt sc = new cnnt();

            sc.insqry = ("UPDATE `customertbl` SET " + (txtupid.Text + ("= \'" + (txtd.Text + ("\' WHERE `Customer_Id`= \'" + (txtui.Text + "\'"))))));
            sc.cnntotbl();
        }
Exemple #5
0
        public void inscupy()
        {
            cnnt sc = new cnnt();

            try
            {
                sc.cnntotbl();
                sc.insqry = ("insert into `customertbl`(`Customer_Id`, `Customer_Fname`, `Customer_Lname`, `Birth_Day`, `Gender`, `Id_Type`, `tpnum`, `Email`) values (\'"
                             + (TxtInum.Text + ("\',\'"
                                                + (TxtFname.Text + ("\',\'"
                                                                    + (TxtLname.Text + ("\',\'"
                                                                                        + (DtpBday.Text + ("\',\'"
                                                                                                           + (CmbGender.SelectedItem + ("\',\'"
                                                                                                                                        + (CmbItp.SelectedItem + ("\',\'"
                                                                                                                                                                  + (TxtTpn.Text + ("\',\'"
                                                                                                                                                                                    + (TxtEml.Text + "\')"))))))))))))))));

                sc.cnntotbl();
                sc.insqry = ("insert into `paymenttbl`(`Bill_Id`, `Amount`, `Paid`, `Balance`, `Emp_Id`, `Time`, `Date_P`, `Customer_Id`) values (\'"
                             + (TxtBnum.Text + ("\',\'"
                                                + (TxtTtl.Text + ("\',\'"
                                                                  + (TxtPd.Text + ("\',\'"
                                                                                   + (TxtBlnc.Text + ("\',\'"
                                                                                                      + (Txt_stfId.Text + ("\',\'"
                                                                                                                           + (DtpTime.Text + ("\',\'"
                                                                                                                                              + (DtpDate.Text + ("\',\'"
                                                                                                                                                                 + (TxtInum.Text + "\')"))))))))))))))));

                sc.cnntotbl();
                sc.insqry = ("insert into `payment_tbl`(`Bill_Id`, `Customer_Id`, `Item_Id`, `Date_B`) values (\'"
                             + (TxtBnum.Text + ("\',\'"
                                                + (TxtInum.Text + ("\',\'"
                                                                   + (TxtIeamId.Text + ("\',\'"
                                                                                        + (DtpDate.Text + "\')"))))))));
            }
            catch (Exception e)
            {
                MessageBox.Show("" + e);
            }
        }
Exemple #6
0
        private void BtnRoom_Click(object sender, EventArgs e)
        {
            cnnt sc = new cnnt();

            inscupy();
            sc.insqry = ("INSERT INTO `roomtbl`(`Room_Id`, `Room_Type`, `Room_category`, `Number_Of_Rooms`, `Adult`, `Child`, `Check_In`, `Check_Out`, `Availability`, `Bill_Id`) VALUES  (\'"
                         + (TxtRmid.Text + ("\',\'"
                                            + (CmbRmtyp.Text + ("\',\'"
                                                                + (CmbRcat.Text + ("\',\'"
                                                                                   + (TxtNrm.Text + ("\',\'"
                                                                                                     + (TxtAdult.Value + ("\',\'"
                                                                                                                          + (TxtChild.Value + ("\',\'"
                                                                                                                                               + (DtpIn.Text + ("\',\'"
                                                                                                                                                                + (DtpOut.Text + ("\',\'0\',\'"
                                                                                                                                                                                  + (TxtBnum.Text + "\' )"))))))))))))))))));
            sc.cnntotbl();
            sc.insqry = ("INSERT INTO `avltbl`(`RoomId`, `SDate`, `numofdays`) VALUES (\'"
                         + (TxtRmid.Text + ("\',\'"
                                            + (DtpIn.Text + ("\',\'"
                                                             + (txtdys.Text + "\' )"))))));
            sc.cnntotbl();
            MessageBox.Show("Done! one record added succesfully!");
        }
Exemple #7
0
 void Button4_Click(object sender, System.EventArgs e)
 {
     try
     {
         cnnt sc = new cnnt();
         sc.insqry = ("update logtbl set Paswrd= \'" + (txtupd.Text + ("\' where Id= \'" + (txtitm.Text + "\'"))));
         sc.cnntotbl();
         MessageBox.Show("Password changed successfully");
     }
     catch (Exception ex)
     {
         MessageBox.Show("error updating password" + ex.Message);
     }
 }
Exemple #8
0
 private void btnshw_Click(object sender, System.EventArgs e)
 {
     try
     {
         cnnt sc = new cnnt();
         sc.cnntotbl();
         sc.insqry = ("SELECT * FROM `paymenttbl` WHERE `Customer_Id` = \'" + (txtcusid.Text + "\' and `Balance` > \'0\'"));
         sc.schfn();
         Dgb.DataSource = sc.stv;
     }
     catch (Exception ex)
     {
         MessageBox.Show(("Please check entered values " + ex.Message));
     }
 }
Exemple #9
0
        private void Button3_Click(object sender, System.EventArgs e)
        {
            DialogResult qu = MessageBox.Show("Are you sure?", "Delete", MessageBoxButtons.YesNo);

            if ((qu == DialogResult.Yes))
            {
                cnnt sc = new cnnt();
                sc.insqry = ("delete  from " + (cmbdel.Text + (" where Room_Id=\'" + (Txtdel.Text + ("\' and Bill_Id=\'" + (txtdel2.Text + "\' "))))));
                MessageBox.Show("Record deleted succusfully!");
                sc.cnntotbl();
            }
            else
            {
                MessageBox.Show("Cancel");
            }
        }
Exemple #10
0
 private void Button2_Click(object sender, System.EventArgs e)
 {
     try
     {
         cnnt sc = new cnnt();
         sc.insqry = ("UPDATE `paymenttbl` SET `Balance`\'" + (txtpbnc.Text + ("\', `Paid` = \'" + (txtttp.Text + ("\' where `Bill_Id` = \'" + (TxtBnum.Text + "\'"))))));
         sc.cnntotbl();
         sc.insqry = ("SELECT * FROM `paymenttbl` WHERE `Customer_Id` = \'" + (txtcusid.Text + "\' and `Balance` > \'0\'"));
         sc.schfn();
         Dgb.DataSource = sc.stv;
     }
     catch (Exception ex)
     {
         MessageBox.Show(("Please check entered values " + ex.Message));
     }
 }