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 Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from mechine_management "; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); MultiView1.SetActiveView(View1); cmd.CommandText = "select max(mechine_id)from mechine_management"; mid = obj.max_id(cmd); cmd.CommandText = "select distinct department from employee_management"; DropDownList1.DataSource = obj.getData(cmd); DropDownList1.DataValueField = "department"; DropDownList1.DataTextField = "department"; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "select"); cmd.CommandText = "select department from employee_management"; DropDownList2.DataSource = obj.getData(cmd); DropDownList2.DataValueField = "department"; DropDownList2.DataTextField = "department"; DropDownList2.DataBind(); DropDownList2.Items.Insert(0, "select"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from employee_management "; DataGrid1.DataSource = obj.getData(cmd); DataGrid1.DataBind(); MultiView1.SetActiveView(View1); cmd.CommandText = "select max(employee_id)from employee_management"; id = obj.max_id(cmd); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(work_assign_id)from work_assign"; a_id = db.max_id(cmd); cmd.CommandText = "select work_id,work_name from work"; DropDownList1.DataSource = db.getData(cmd); DropDownList1.DataValueField = "work_id"; DropDownList1.DataTextField = "work_name"; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "select"); cmd.CommandText = "select employee_id,employee_name from employee_management where emptype='worker'"; DropDownList2.DataSource = db.getData(cmd); DropDownList2.DataValueField = "employee_id"; DropDownList2.DataTextField = "employee_name"; DropDownList2.DataBind(); DropDownList2.Items.Insert(0, "select"); } }
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 = "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 Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from complaints where type='Technician' and employee_id= '" + Session["id"] + "'"; DataGrid2.DataSource = obj.getData(cmd); DataGrid2.DataBind(); MultiView1.SetActiveView(View2); cmd.CommandText = "select max(cmp_id)from complaints"; id = obj.max_id(cmd); cmd.CommandText = "select employee_name from employee_management where employee_id='" + Session["id"] + "'"; DataTable dt = obj.getData(cmd); if (dt.Rows.Count > 0) { TextBox4.Text = dt.Rows[0][0].ToString(); } TextBox3.Text = DateTime.Now.ToShortDateString(); } }
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 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 Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MultiView1.SetActiveView(View1); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(fault_id)from fault_prediction"; id = db.max_id(cmd); cmd.CommandText = "select mechine_id,mechine_name from mechine_management"; DropDownList1.DataSource = db.getData(cmd); DropDownList1.DataValueField = "mechine_id"; DropDownList1.DataTextField = "mechine_name"; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "select"); cmd.CommandText = "select employee_id,employee_name from employee_management where emptype='worker'"; DropDownList4.DataSource = db.getData(cmd); DropDownList4.DataValueField = "employee_id"; DropDownList4.DataTextField = "employee_name"; DropDownList4.DataBind(); DropDownList4.Items.Insert(0, "select"); cmd.CommandText = "select employee_id,employee_name from employee_management where emptype='technician'"; DropDownList3.DataSource = db.getData(cmd); DropDownList3.DataValueField = "employee_id"; DropDownList3.DataTextField = "employee_name"; DropDownList3.DataBind(); DropDownList3.Items.Insert(0, "select"); cmd.CommandText = "select * from fault_prediction"; DataGrid1.DataSource = db.getData(cmd); DataGrid1.DataBind(); } }
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 = ""; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MultiView1.SetActiveView(View1); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(reqt_id)from parts_request"; id = db.max_id(cmd); 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(); cmd.CommandText = "select mechine_id,mechine_name from mechine_management"; DropDownList1.DataSource = db.getData(cmd); DropDownList1.DataValueField = "mechine_id"; DropDownList1.DataTextField = "mechine_name"; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "select"); TextBox3.Text = System.DateTime.Now.ToShortDateString(); } }
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; }