private void button3_Click(object sender, EventArgs e) { if (Validation2()) { if (tnew.Text.Equals(trnew.Text)) { err.Dispose(); String oldp = db.GetValue("SELECT [Password]FROM [AVVMS].[dbo].[Login]"); if (oldp.Equals(told.Text)) { db.Ins_Up_Del("UPDATE [AVVMS].[dbo].[Login]SET [Password] = '" + tnew.Text + "'"); MessageBox.Show("Up Success"); Common_Tasks.nullify(told); Common_Tasks.nullify(tnew); Common_Tasks.nullify(trnew); } else { err.Dispose(); err.SetError(told, "Enter Correct old password"); told.Focus(); } } else { err.Dispose(); err.SetError(tnew, "Unmatched passwords"); tnew.Focus(); } } }
public Trip_Completion(string id, string vehicle, string purpose, string name, string address, string mobile, string driver, string startm, string startt, string sdate, string remark, string j) { InitializeComponent(); jtype = 1; dateTimePicker1.MinDate = DateTime.Parse(sdate); numericUpDown1.Minimum = ((Convert.ToInt32(startm))); DGV_traffic_exception.Rows.Add("Toll Fee", "", ""); DGV_traffic_exception.Rows.Add("Parking Fee", "", ""); DGV_traffic_exception.Rows.Add("Fuel", "", ""); label20.Text = id; lb_address.Text = address; lb_driver.Text = driver; lb_mobile.Text = mobile; lb_name.Text = name; lb_purpose.Text = purpose; lb_smeter.Text = startm; lb_vehicle.Text = vehicle; lb_remarks.Text = remark; ld_sdatea.Text = sdate + " " + startt; date = sdate; lb_j.Text = j; Common_Tasks.nullify(lb_fc); Common_Tasks.nullify(lb_sc); Common_Tasks.nullify(label11); Common_Tasks.nullify(label4); label31.Text = db.GetValue("SELECT [mail]FROM [AVVMS].[dbo].[Trips] where [Id]='" + id + "'"); groupBox2.Text = groupBox2.Text + " : For Driver"; lbextraheavy.Hide(); tkmdheavy.Hide(); panelheavy.Hide(); lb_b.Hide(); txt_hbatha.Hide(); ebatha.Text = db.GetValue("SELECT [light extra amount]FROM [AVVMS].[dbo].[batha]"); hbatha.Text = db.GetValue("SELECT [light hault batha]FROM [AVVMS].[dbo].[batha]"); ini_flag = 1; }
private void dataGridView6_Click(object sender, EventArgs e) { if (dataGridView6.SelectedRows.Count != 0) { groupBox1.Text = "Trip No. : " + dataGridView6.SelectedRows[0].Cells[0].Value.ToString(); if (db.GetValue("SELECT [Type]FROM [AVVMS].[dbo].[Vehicles] where [Vehicle No.]='" + dataGridView6.SelectedRows[0].Cells[1].Value.ToString() + "'").Contains("Heavy")) { dt = db.GetTable("SELECT [first cleaner],[second cleaner],[address],[start meter],[start time],[moment slip no.]FROM [AVVMS].[dbo].[Trips] where [id]=" + dataGridView6.SelectedRows[0].Cells[0].Value.ToString() + ""); lb_fc.Text = "First Cleaner : " + dt.Rows[0]["first cleaner"].ToString(); if (dt.Rows[0]["second cleaner"].ToString().Equals("")) { Common_Tasks.nullify(lb_sc); } else { lb_sc.Text = "Second Cleaner : " + dt.Rows[0]["second cleaner"].ToString(); } } else { Common_Tasks.nullify(lb_fc); Common_Tasks.nullify(lb_sc); dt = db.GetTable("SELECT [address],[start meter],[start time],[moment slip no.]FROM [AVVMS].[dbo].[Trips] where [id]=" + dataGridView6.SelectedRows[0].Cells[0].Value.ToString() + ""); } lb_address.Text = "Provider Address : " + dt.Rows[0]["address"].ToString(); lb_startmeter.Text = "Start Meter : " + dt.Rows[0]["start meter"].ToString(); lb_starttime.Text = "Start Time : " + dt.Rows[0]["start time"].ToString(); lb_moment.Text = "Moment Slip No. : " + dt.Rows[0]["moment slip no."].ToString(); groupBox1.Show(); } }
public Trip_Completion(string id, string vehicle, string purpose, string name, string address, string mobile, string driver, string startm, string startt, string sdate, string remark, string j, string fc, string sc) { InitializeComponent(); dateTimePicker1.MinDate = DateTime.Parse(sdate); numericUpDown1.Minimum = ((Convert.ToInt32(startm))); DGV_traffic_exception.Rows.Add("Toll Fee", "", ""); DGV_traffic_exception.Rows.Add("Parking Fee", "", ""); DGV_traffic_exception.Rows.Add("Fuel", "", ""); label20.Text = id; lb_address.Text = address; lb_driver.Text = driver; lb_mobile.Text = mobile; lb_name.Text = name; lb_purpose.Text = purpose; lb_smeter.Text = startm; lb_vehicle.Text = vehicle; lb_remarks.Text = remark; ld_sdatea.Text = sdate + " " + startt; date = sdate; lb_j.Text = j; lb_fc.Text = fc; lb_sc.Text = sc; label31.Text = db.GetValue("SELECT [mail]FROM [AVVMS].[dbo].[Trips] where [Id]='" + id + "'"); tefc.Text = db.GetValue("SELECT [heavy extra amount cleaner]FROM [AVVMS].[dbo].[batha]"); if (db.GetValue("SELECT [Type]FROM [AVVMS].[dbo].[Employee] where [Employee ID]='" + fc + "'").Equals("Permanent")) { tkmfc.Text = db.GetValue("SELECT [heavy km alavence permanent cleaner]FROM [AVVMS].[dbo].[batha]"); } else { tkmfc.Text = db.GetValue("SELECT [heavy km alavance temporary cleaner]FROM [AVVMS].[dbo].[batha]"); } if (sc.Equals("")) { groupBox2.Text = groupBox2.Text + " : For Driver,First Cleaner"; panel2sc.Hide(); Common_Tasks.nullify(label4); jtype = 2; } else { groupBox2.Text = groupBox2.Text + " : For Driver,First Cleaner,Second Cleaner"; jtype = 3; tesc.Text = tefc.Text; if (db.GetValue("SELECT [Type]FROM [AVVMS].[dbo].[Employee] where [Employee ID]='" + sc + "'").Equals("Permanent")) { tkmsc.Text = db.GetValue("SELECT [heavy km alavence permanent cleaner]FROM [AVVMS].[dbo].[batha]"); } else { tkmsc.Text = db.GetValue("SELECT [heavy km alavance temporary cleaner]FROM [AVVMS].[dbo].[batha]"); } } lb_b.Hide(); txt_hbatha.Hide(); ebatha.Text = db.GetValue("SELECT [heavy extra amount driver]FROM [AVVMS].[dbo].[batha]"); hbatha.Text = db.GetValue("SELECT [heavy hault batha]FROM [AVVMS].[dbo].[batha]"); tkmdheavy.Text = db.GetValue("SELECT [heavy km alavence driver]FROM [AVVMS].[dbo].[batha]"); ini_flag = 1; }