protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); SqlCommand cn = new SqlCommand(); string vid = DropDownList5.SelectedValue.ToString(); cn.CommandText = "select seats from venue_table where venue_id='" + vid + "'"; DataTable dt2 = db.getdata(cn); DateTime di = Convert.ToDateTime(txttime0.Text); int strttime = (di.Hour * 60) + di.Minute; cmd.CommandText = "select * from book_table where venue_id='" + vid + "' and date='" + txtdate.Text + "' and end_time> '" + strttime + "'"; DataTable dt = db.getdata(cmd); // int w = CompareValidator(txt_endtime, txt_time); if (dt.Rows.Count > 0) { Response.Write("<script>alert('Sorry,Venue is not available in this time or date')</script>"); } else { cmd.CommandText = "update book_table set date = '" + txtdate.Text + "',department = '" + txtdep.Text + "',time = '" + txttime0.Text + "',evnt_name= '" + txtprg.Text + "',block = '" + dd_block.SelectedItem + "',phone = '" + txtcor.Text + "',no_of_seats = '" + txtno.Text + "',venue_id = '" + DropDownList5.SelectedValue + "',coordinator='" + TextBox1.Text + "' WHERE bookid= '" + Label2.Text + "'";; db.execute(cmd); cmd.CommandText = "select * from book_table where regno='" + Label1.Text + "'"; DataGrid1.DataSource = db.getdata(cmd); DataGrid1.DataBind(); MultiView1.SetActiveView(View1); } }
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e) { SqlCommand cmd = new SqlCommand(); if (e.CommandName == "accept") { cmd.CommandText = "update parts_request set status = 'accept' where reqt_id=" + e.Item.Cells[0].Text; obj.execute(cmd); Response.Write("<script>alert('Accept')</script>"); cmd.CommandText = "SELECT parts_request.reqt_id, parts_request.technician_id, employee_management.employee_name, parts_request.mechine_id, mechine_management.mechine_name, parts_request.parts, parts_request.description, parts_request.date, parts_request.status FROM parts_request INNER JOIN employee_management ON parts_request.technician_id = employee_management.employee_id INNER JOIN mechine_management ON parts_request.mechine_id = mechine_management.mechine_id where parts_request.status='pending'"; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); } else if (e.CommandName == "reject") { cmd.CommandText = "update parts_request set status = 'reject' where reqt_id=" + e.Item.Cells[0].Text; obj.execute(cmd); Response.Write("<script>alert('Reject')</script>"); cmd.CommandText = "SELECT parts_request.reqt_id, parts_request.technician_id, employee_management.employee_name, parts_request.mechine_id, mechine_management.mechine_name, parts_request.parts, parts_request.description, parts_request.date, parts_request.status FROM parts_request INNER JOIN employee_management ON parts_request.technician_id = employee_management.employee_id INNER JOIN mechine_management ON parts_request.mechine_id = mechine_management.mechine_id where parts_request.status='pending'"; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); } }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "update Passenger_info set status='Approved' where ID='" + Label1.Text + "'"; db.execute(cmd); cmd.CommandText = "select * from passenger_info where status='pending'"; DataGrid1.DataSource = db.getdata(cmd); DataGrid1.DataBind(); }
public string OwnerReg(string nam, string phno, string email, string psswd, string gender) { string s = ""; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(ID) from Login_page"; int i = db.max_id(cmd); cmd.CommandText = "insert into Ownerinfo values (" + i + ",'" + nam + "','" + phno + "','" + gender + "','" + email + "','" + psswd + "','pending')"; SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "insert into Login_page values(" + i + ",'" + email + "','" + psswd + "','owner')"; try { db.execute(cmd); db.execute(cmd1); s = "success"; } catch { s = "error"; } return(s); }
protected void Button2_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "delete from dev_request_table where req_id='" + Label1.Text + "'"; db.execute(cmd); Response.Write("<script>alert('Rejected')</script>"); MultiView1.SetActiveView(View1); cmd.CommandText = "select* from dev_request_table "; DataGrid1.DataSource = db.getdata(cmd); DataGrid1.DataBind(); }
protected void Button2_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "insert into parts_request values('" + id + "','" + Session["id"] + "','" + DropDownList1.SelectedValue + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','pending')"; db.execute(cmd); TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; DropDownList1.SelectedIndex = -1; Response.Write("<script>alert('Request')</script>"); cmd.CommandText = "select max(reqt_id)from parts_request"; id = db.max_id(cmd); MultiView1.SetActiveView(View1); cmd.CommandText = "SELECT parts_request.mechine_id, parts_request.reqt_id, parts_request.technician_id, parts_request.parts, parts_request.description, parts_request.date, parts_request.status, mechine_management.mechine_name FROM parts_request INNER JOIN mechine_management ON parts_request.mechine_id = mechine_management.mechine_id where parts_request.status='pending' and parts_request.technician_id='" + Session["id"] + "'"; DataGrid1.DataSource = db.getData(cmd); DataGrid1.DataBind(); TextBox3.Text = System.DateTime.Now.ToShortDateString(); }
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "status") { MultiView1.SetActiveView(View3); Label1.Text = e.Item.Cells[5].Text; Label2.Text = e.Item.Cells[7].Text; Label3.Text = e.Item.Cells[8].Text; Label4.Text = e.Item.Cells[4].Text; } if (e.CommandName == "request") { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select status from fault_prediction where status='requested' and fault_id='" + e.Item.Cells[0].Text + "'"; DataTable dt = obj.getData(cmd); if (dt.Rows.Count > 0) { Response.Write("<script>alert('Already Requested')</script>"); } else { cmd.CommandText = "update fault_prediction set status='requested' where fault_id='" + e.Item.Cells[0].Text + "'"; obj.execute(cmd); Response.Write("<script>alert('Requested')</script>"); cmd.CommandText = "SELECT fault_prediction.mechine_id, fault_prediction.fault_id, mechine_management.mechine_name, fault_prediction.worker_id, fault_prediction.technician_id, employee_management.employee_name, fault_prediction.date, fault_prediction.time, fault_prediction.problem, fault_prediction.status FROM fault_prediction INNER JOIN mechine_management ON fault_prediction.mechine_id = mechine_management.mechine_id INNER JOIN employee_management ON fault_prediction.worker_id = employee_management.employee_id"; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); MultiView1.SetActiveView(View1); } } }
protected void Button2_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "delete from ownerinfo where ID='" + TextBox1.Text + "'"; db.execute(cmd); Response.Write("<script>alert('Rejected')</script>"); MultiView1.SetActiveView(View1); cmd.CommandText = "select * from Ownerinfo"; DataGrid1.DataSource = db.getdata(cmd); DataGrid1.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = " update complaints set reply = '" + TextBox4.Text + "' where cmp_id= '" + Label1.Text + "'"; obj.execute(cmd); }
protected void Button2_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "insert into work_assign values('" + a_id + "','" + DropDownList1.SelectedValue + "','" + DropDownList2.SelectedValue + "','" + TextBox5.Text + "','" + TextBox6.Text + "','pending')"; db.execute(cmd); TextBox5.Text = ""; }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "Delete From book_table Where bookid='" + txtid.Text + "'"; //DataTable dt = db.getdata(cmd); db.execute(cmd); Response.Write("<script>alert('Successfully deleted')</script>"); }
protected void Button1_Click1(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); // cmd.CommandText = "select max(ID) from product_table"; // int id = db.max_id(cmd); if (RadioButton1.Checked) { cmd.CommandText = "insert into reg values ('" + txtname.Text + "','" + txtreg.Text + "','male','" + dd_course.SelectedItem.Text + "','" + dd_sem.SelectedItem.Text + "','" + txt_phn.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "')"; db.execute(cmd); Response.Write("<script>alert('Registered')</script>"); } else { cmd.CommandText = "insert into reg values ('" + txtname.Text + "','" + txtreg.Text + "','female','" + dd_course.SelectedValue + "','" + dd_sem.SelectedValue + "','" + dd_course.SelectedValue + "','" + txt_phn.Text + "', '" + TextBox4.Text + "','" + TextBox5.Text + "')"; db.execute(cmd); Response.Write("<script>alert('Registered')</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "insert into Bus_Schedule values(" + DropDownList2.SelectedValue + ",'" + DropDownList1.SelectedItem.Text + "','" + TextBox1.Text + "','pending')"; db.execute(cmd); TextBox1.Text = ""; Response.Write("<script>alert('Time Saved')</script>"); }
protected void Button2_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(mechine_id)from mechine_management"; mid = obj.max_id(cmd); cmd.CommandText = "insert into mechine_management values('" + mid + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + DropDownList1.SelectedValue + "','" + TextBox4.Text + "','" + TextBox5.Text + "')"; obj.execute(cmd); TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; cmd.CommandText = "select * from mechine_management"; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); MultiView1.SetActiveView(View1); }
public ActionResult addnew_patient(FormCollection fm) { prc.p_name = fm["ctl00$MainContent$pnameText"]; prc.p_gender = fm["ctl00$MainContent$RadioButtonListGender"]; prc.p_dob = fm["ctl00$MainContent$PdobText"]; prc.p_address = fm["ctl00$MainContent$paddressText"]; prc.p_city = fm["ctl00$MainContent$pcityText"]; prc.p_state = fm["ctl00$MainContent$pstateText"]; prc.p_pin = fm["ctl00$MainContent$ppinText"]; prc.p_mobile = fm["ctl00$MainContent$pmobText"]; prc.p_email = fm["ctl00$MainContent$pmailText"]; prc.pid = Convert.ToInt32(Session["logid"]); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "insert_patient"; //ENCRYPTED INSERTION// cmd1.Parameters.AddWithValue("@pid", prc.pid); cmd1.Parameters.AddWithValue("@pname", prc.p_name); cmd1.Parameters.AddWithValue("@gender", prc.p_gender); cmd1.Parameters.AddWithValue("@dob", prc.p_dob); cmd1.Parameters.AddWithValue("@address", prc.p_address); cmd1.Parameters.AddWithValue("@city", prc.p_city); cmd1.Parameters.AddWithValue("@state", prc.p_state); cmd1.Parameters.AddWithValue("@pincode", prc.p_pin); cmd1.Parameters.AddWithValue("@mobile", prc.p_mobile); cmd1.Parameters.AddWithValue("@email", prc.p_email); d.execute(cmd1); //TempData["notice"] = "successfully registered"; //string message = "Successfully submitted"; //System.Text.StringBuilder sb = new System.Text.StringBuilder(); //sb.Append("<script type = 'text/javascript'>"); //sb.Append("window.onload=function(){"); //sb.Append("alert('"); //sb.Append(message); //sb.Append("')};"); //sb.Append("</script>"); //ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString()); return(RedirectToAction("patient_portfolio_show")); }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(Stop_no) from Root_Schedule"; id = db.max_id(cmd); string rid = DropDownList1.SelectedValue.ToString(); cmd.CommandText = "insert into Root_Schedule values('" + id + "','" + rid + "','" + TextBox1.Text + "')"; db.execute(cmd); }
protected void btnisue_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(issueid) from issue_table"; int id = db.max_id(cmd); cmd.CommandText = "insert into issue_table values('" + id + "','" + txtreg.Text + "','" + CheckBoxList3.SelectedItem.Text + "','" + txtdate.Text + "','" + txttim.Text + "')"; db.execute(cmd); Response.Write("<script>alert(' Successfully issued')</script>"); }
public string complaints(string uid, string comp, string type) { string s = ""; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(cmp_id) from complaints"; int id = db.max_id(cmd); cmd.CommandText = "insert into complaints values('" + id + "','" + uid + "','" + type + "','" + comp + "','pending','" + System.DateTime.Now.ToShortDateString() + "')"; try { db.execute(cmd); s = "success"; } catch { s = "error"; } return(s); }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "update fault_prediction set time = '" + TextBox6.Text + "',status='process' where fault_id='" + Label1.Text + "'"; obj.execute(cmd); Response.Write("<script>alert('Time is Set')</script>"); cmd.CommandText = "SELECT fault_prediction.mechine_id, fault_prediction.fault_id, mechine_management.mechine_name, fault_prediction.technician_id, employee_management.employee_name, fault_prediction.date, fault_prediction.time, fault_prediction.problem, fault_prediction.status FROM fault_prediction INNER JOIN mechine_management ON fault_prediction.mechine_id = mechine_management.mechine_id INNER JOIN employee_management ON fault_prediction.technician_id = employee_management.employee_id WHERE (fault_prediction.worker_id = 1)"; DataGrid2.DataSource = obj.getData(cmd); DataGrid2.DataBind(); MultiView1.SetActiveView(View1); }
protected void Button9_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(fault_id)from fault_prediction"; id = db.max_id(cmd); cmd.CommandText = "insert into fault_prediction values('" + id + "','" + DropDownList1.SelectedValue + "','" + DropDownList4.SelectedValue + "','" + DropDownList3.SelectedValue + "','" + TextBox2.Text + "','No Time','" + TextBox3.Text + "','pending')"; db.execute(cmd); DropDownList1.SelectedIndex = -1; DropDownList4.SelectedIndex = -1; DropDownList3.SelectedIndex = -1; TextBox2.Text = ""; TextBox3.Text = ""; }
protected void Button2_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(ID) from product_table"; int id = db.max_id(cmd); cmd.CommandText = "insert into product_table values ('" + id + "','" + txttyp.Text + "','" + txtqnt.Text + "','" + DropDownList1.SelectedValue + "','0')"; db.execute(cmd); Response.Write("<script>alert('Devices Added')</script>"); txtqnt.Text = ""; txttyp.Text = ""; }
protected void DataGrid2_ItemCommand(object source, DataGridCommandEventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "update fault_prediction set status='finish' where fault_id='" + e.Item.Cells[0].Text + "'"; obj.execute(cmd); Response.Write("<script>alert('Finish success')</script>"); cmd.CommandText = "SELECT fault_prediction.fault_id, mechine_management.mechine_name, employee_management.employee_name, fault_prediction.date, fault_prediction.time, fault_prediction.problem, fault_prediction.status, fault_prediction.mechine_id, fault_prediction.worker_id FROM fault_prediction INNER JOIN mechine_management ON fault_prediction.mechine_id = mechine_management.mechine_id INNER JOIN employee_management ON fault_prediction.worker_id = employee_management.employee_id WHERE (fault_prediction.technician_id = '" + Session["id"] + "') AND (fault_prediction.status = 'process')"; DataGrid2.DataSource = obj.getData(cmd); DataGrid2.DataBind(); MultiView1.SetActiveView(View1); }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(ID) from Root_info"; id = db.max_id(cmd); cmd.CommandText = "insert into Root_info values('" + id + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')"; db.execute(cmd); Response.Write("<script>alert('Root Added')</script>"); TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(req_id) from dev_request_table"; int id = db.max_id(cmd); cmd.CommandText = "insert into dev_request_table values ('" + id + "','" + Label1.Text + "','" + DropDownList1.SelectedItem.Text + "','" + txtdate.Text + "','" + txtstime.Text + "','" + txtetime.Text + "','" + dd_dev.SelectedValue + "','" + dd_qn.SelectedValue + "','pending')"; db.execute(cmd); Response.Write("<script>alert('Devices Added')</script>"); txtdate.Text = ""; txtetime.Text = ""; txtstime.Text = ""; }
public ActionResult newpatient_reg(FormCollection fm) { //RANDOM PASSWORD// Random rd = new Random(); string ps = rd.Next(000000, 999999).ToString() + Session["logid"].ToString(); uc.usern = fm["ctl00$ContentPlaceHolder1$UnameText"]; string mail = fm["ctl00$ContentPlaceHolder1$mailText"]; uc.passd = ps; uc.usertype = "Patient"; SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "maxid_in_login"; db.maxid(cmd2); pa.did = Convert.ToInt32(Session["logid"]); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "add_patient"; cmd1.Parameters.AddWithValue("@uid", db.maxid(cmd2)); cmd1.Parameters.AddWithValue("@uname", uc.usern); cmd1.Parameters.AddWithValue("@passw", uc.passd); cmd1.Parameters.AddWithValue("@utype", uc.usertype); cmd1.Parameters.AddWithValue("@did", pa.did); cmd1.Parameters.AddWithValue("@date", System.DateTime.Now); db.execute(cmd1); //FORWARD PASSWORD TO PATIENT// string s = mg.sentmail(uc.usern, uc.passd, mail); return(RedirectToAction("doc_add_patient"));//show succes or failure along// }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(employee_id)from employee_management"; id = obj.max_id(cmd); cmd.CommandText = "insert into employee_management values('" + id + "','" + TextBox1.Text + "','" + DropDownList5.SelectedItem.Text + "','" + DropDownList4.SelectedItem.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox16.Text + "','" + TextBox17.Text + "')"; obj.execute(cmd); cmd.CommandText = "insert into login values('" + id + "','" + TextBox16.Text + "','" + TextBox17.Text + "','" + DropDownList4.SelectedItem.Text + "')"; obj.execute(cmd); TextBox1.Text = ""; DropDownList5.SelectedIndex = -1; DropDownList4.SelectedIndex = -1; TextBox6.Text = ""; TextBox16.Text = ""; TextBox17.Text = ""; cmd.CommandText = "select * from employee_management"; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); MultiView1.SetActiveView(View1); }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(cmp_id)from complaints"; id = obj.max_id(cmd); cmd.CommandText = "insert into complaints values('" + id + "','" + Session["id"] + "','technician','" + TextBox2.Text + "','pending','" + TextBox3.Text + "')"; obj.execute(cmd); TextBox2.Text = ""; TextBox3.Text = ""; cmd.CommandText = "select * from complaints where type='Technician' and employee_id= '" + Session["id"] + "'"; DataGrid2.DataSource = obj.getData(cmd); DataGrid2.DataBind(); MultiView1.SetActiveView(View2); }
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e) { SqlCommand cmd = new SqlCommand(); if (e.CommandName == "approve") { cmd.CommandText = "update work_assign set status = 'approve' where work_assign_id=" + e.Item.Cells[0].Text; obj.execute(cmd); cmd.CommandText = "SELECT work_assign.work_id, work_assign.work_assign_id, work.work_name, work_assign.worker_id, work_assign.from_date, work_assign.to_date FROM work_assign INNER JOIN work ON work_assign.work_id = work.work_id where work_assign.worker_id ='" + Session["id"] + "' and work_assign.status='pending'"; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); } else if (e.CommandName == "reject") { cmd.CommandText = "update work_assign set status = 'reject' where work_assign_id=" + e.Item.Cells[0].Text; obj.execute(cmd); cmd.CommandText = "SELECT work_assign.work_id, work_assign.work_assign_id, work.work_name, work_assign.worker_id, work_assign.from_date, work_assign.to_date FROM work_assign INNER JOIN work ON work_assign.work_id = work.work_id where work_assign.worker_id ='" + Session["id"] + "' and work_assign.status='pending'"; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); } }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); SqlCommand cn = new SqlCommand(); string vid = dd_venue.SelectedValue.ToString(); cn.CommandText = "select seats from venue_table where venue_id='" + vid + "'"; DataTable dt2 = db.getdata(cn); DateTime di = Convert.ToDateTime(txt_time.Text); int strttime = (di.Hour * 60) + di.Minute; cmd.CommandText = "select * from book_table where venue_id='" + vid + "' and date='" + txt_date.Text + "' and end_time> '" + strttime + "'"; DataTable dt = db.getdata(cmd); // int w = CompareValidator(txt_endtime, txt_time); if (dt.Rows.Count > 0) { Response.Write("<script>alert('Sorry,Venue is not available in this time or date')</script>"); } else { cmd.CommandText = "select max(bookid) from book_table"; id = db.max_id(cmd); //string vid = dd_venue.SelectedValue.ToString(); DateTime dr1 = Convert.ToDateTime(txt_time.Text); int total1 = (dr1.Hour * 60) + dr1.Minute; DateTime dr = Convert.ToDateTime(txt_endtime.Text); int total = (dr.Hour * 60) + dr.Minute; cmd.CommandText = "insert into book_table values('" + id + "','" + txt_date.Text + "','" + txt_reg.Text + "','" + dd_dep.SelectedItem.Text + "','" + txt_time.Text + "','" + txt_evnt.Text + "','" + dd_blck.SelectedItem.Text + "','" + txt_phn.Text + "','" + txt_no.Text + "','" + vid + "','pending','" + total + "','" + txt_cor.Text + "','" + total1 + "','" + txt_endtime.Text + "')"; db.execute(cmd); Response.Write("<script>alert('Venue Successfully booked')</script>"); txt_cor.Text = ""; txt_date.Text = ""; txt_endtime.Text = ""; txt_evnt.Text = ""; txt_no.Text = ""; txt_phn.Text = ""; txt_reg.Text = ""; txt_time.Text = ""; dd_blck.SelectedIndex = -1; dd_dep.SelectedIndex = -1; dd_venue.SelectedIndex = -1; } }
protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(ID) from Bus_info"; id = db.max_id(cmd); string rid = DropDownList3.SelectedValue.ToString(); cmd.CommandText = "insert into Bus_info values('" + id + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + DropDownList1.SelectedItem.Text + "','" + DropDownList2.SelectedItem.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','pending','0','" + rid + "')"; db.execute(cmd); Response.Write("<script>alert('Bus Added')</script>"); TextBox1.Text = ""; TextBox2.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; DropDownList1.SelectedIndex = -1; DropDownList2.SelectedIndex = -1; }