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(); }
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)); } }
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(); }
private void frmavlrm_Load(object sender, System.EventArgs e) { try { cmd = new MySqlCommand("SELECT * from 'ct_room", connection); cnnt sc = new cnnt(); sc.insqry = "SELECT * from 'ct_room"; MySqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { if ((reader[1].ToString() == "rmlux")) { var form = new frmavlrm(); // Button btn = (Button)e.Row.FindControl("btnSalvage"); form.Controls[Convert.ToInt32(reader[0])].BackColor = Color.Blue; MessageBox.Show("" + reader); } } reader.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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(); }
private void Button2_Click(object sender, System.EventArgs e) { cnnt sc = new cnnt(); sc.insqry = ("select * from " + (Cmbtbls.SelectedItem + (" where " + (cmbfld.Text + (" =\'" + (Txtsrch.Text + "\' ")))))); sc.schfn(); Dgvsrch.DataSource = sc.stv; }
private void Button1_Click(object sender, System.EventArgs e) { cnnt sc = new cnnt(); sc.insqry = ("select * from " + (Cmbup.SelectedItem + (" where " + (txtupid.Text + (" = \'" + (txtui.Text + "\' ")))))); sc.schfn(); dgvu.DataSource = sc.stv; }
private void Button4_Click(object sender, System.EventArgs e) { cnnt sc = new cnnt(); sc.insqry = ("select * from " + (cmbdel.SelectedItem + " ")); sc.schfn(); Dgvsrch.DataSource = sc.stv; }
private void btnshw_Click(object sender, EventArgs e) { cnnt sc = new cnnt(); sc.insqry = ("select * from " + (Cmbup.SelectedItem + " ")); sc.schfn(); dgvu.DataSource = sc.stv; }
private void BtnUninv_Click(object sender, System.EventArgs e) { var Frm = new FrmSUD(); Frm.Show(); Frm.Pnlup.Visible = false; cnnt sc = new cnnt(); sc.insqry = "SELECT * FROM `paymenttbl` WHERE Balance >\'0\' "; sc.schfn(); Frm.Dgvsrch.DataSource = sc.stv; }
private void SalesToolStripMenuItem_Click(object sender, EventArgs e) { var Frm = new FrmSUD(); Frm.Show(); Frm.Pnlup.Visible = false; cnnt sc = new cnnt(); sc.insqry = "SELECT * FROM `paymenttbl`"; sc.schfn(); Frm.Dgvsrch.DataSource = sc.stv; }
private void BtnPrice_Click(object sender, System.EventArgs e) { var Frm = new FrmSUD(); Frm.Show(); Frm.Pnlup.Visible = false; cnnt sc = new cnnt(); sc.insqry = "SELECT * FROM `pricetbl`"; sc.schfn(); Frm.Dgvsrch.DataSource = sc.stv; }
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); } }
private void Button2_Click(object sender, System.EventArgs e) { // DateTime dtp = dtp1.Text; cnnt cn = new cnnt(); // cn.insqry = ("select Amount from Paymenttbl where Date_P = \'" + (dtp + "\' ")); cn.rdrpl(); // this.Chart1.Series("sales").Points.AddXY(dtp, cn.dt); for (int i = 1; (i <= 6); i++) { // cn.insqry = ("select Amount from Paymenttbl where Date_P=\'" + (dtp.AddDays((i * -1)) + "\'")); cn.rdrpl(); // this.Chart1.Series("sales").Points.AddXY(dtp.AddDays((i * -1)), cn.dt); } }
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)); } }
private void CmbRcat_Click(object sender, System.EventArgs e) { cnnt sc = new cnnt(); sc.insqry = "SELECT `Category` FROM `ct_room` "; sc.rdr(); CmbRcat.Items.Add(sc.dt); //SELECT DISTINCT CustomerID FROM Orders; try { } catch (Exception ex) { } }
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)); } }
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"); } }
private void btnsearch_Click(object sender, EventArgs e) { try { { cnnt sc = new cnnt(); sc.insqry = ("select * from insert where productID='" + (productID.Text + "' ")); sc.schfn(); dataGridView1.DataSource = sc.stv; } } catch (Exception ex) { MessageBox.Show("" + ex); } }
private void TxtBnum_Leave(object sender, System.EventArgs e) { cnnt sc = new cnnt(); try { sc.insqry = ("SELECT `Amount`, `Paid`, `Balance` FROM `paymenttbl` Bill_Id = \'" + (TxtBnum.Text + "\'")); sc.rdrfl(); string bnm = sc.bt; TxtTtl.Text = bnm; TxtBlnc.Text = sc.name; TxtPd.Text = sc.dt; Button1.Visible = true; } catch (Exception ex) { } }
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); } }
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!"); }
private void Button111_Click(object sender, System.EventArgs e) { try { foreach (Control c in Controls) { ((Button)(btn)).Enabled = true; c.BackColor = Color.Red; } } catch (Exception ex) { MessageBox.Show("Something went wrong please close the current window and open it again"); } cnnt sc = new cnnt(); try { int nmd = Convert.ToInt32(txtndys.Text); string insqry; string connt; DateTime strdate = dtp1.Value.Date; strdate = strdate.AddDays(-11); cmd = new MySqlCommand("select * from ct_room "); MySqlDataReader reader1 = cmd.ExecuteReader(); while (reader1.Read()) { if (lblty.Text == Convert.ToString(reader1[3])) { } else { var form = new frmavlrm(); form.Controls[Convert.ToInt32(reader1[0])].BackColor = Color.Maroon; form.Controls[Convert.ToInt32(reader1[0])].Enabled = false; foreach (var item in form.Controls) { if (item is Button) { ((Button)item).BackColor = Color.Maroon; } } } } reader1.Close(); // insqry = "select * from avltbl where SDate >'" & strdate.Date & "' " cmd = new MySqlCommand("SELECT * FROM `avltbl`"); MySqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { DateTime stdate = DateTime.Parse(dtp1.Text); DateTime nextDate = DateTime.Parse(dtp1.Text); for (int i = 1; (i <= nmd); i++) { if ((nextDate == DateTime.Parse(reader[1].ToString()))) { var form = new frmavlrm(); form.Controls[Convert.ToInt32(reader1[0])].BackColor = Color.Red; form.Controls[Convert.ToInt32(reader1[0])].Enabled = false; } nextDate = nextDate.AddDays(1); } nextDate = DateTime.Parse(dtp1.Text); for (int i = 1; (i <= 10); i++) { if ((nextDate == DateTime.Parse(reader[1].ToString()))) { if ((Convert.ToInt32(reader[2]) > (i - 1))) { var form = new frmavlrm(); form.Controls[Convert.ToInt32(reader1[0])].BackColor = Color.Red; form.Controls[Convert.ToInt32(reader1[0])].Enabled = false; } } nextDate = nextDate.AddDays(-1); } } reader.Close(); } catch (Exception ex) { } }