protected void Page_Load(object sender, EventArgs e) { dbcon db1 = new dbcon(); ddl1.Items.Add("select AM"); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select distinct * from am_tbl"; SqlDataReader dr1 = db1.executeread(cmd1); while (dr1.Read()) { ddl1.Items.Add(dr1.GetString(1) + " - " + dr1.GetString(4)); } string a = Request.QueryString["staffid"]; txt1.Text = a; dbcon db = new dbcon(); SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "select * from staff_tbl where staffid=@staffid"; cmd2.Parameters.AddWithValue("@staffid", a); SqlDataReader dr = db.executeread(cmd2); dr.Read(); txt2.Text = dr.GetString(1); txt3.Text = dr.GetString(7); }
protected void Page_Load(object sender, EventArgs e) { dbcon db = new dbcon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select staffid from KEY_GEN"; SqlDataReader dr = db.executeread(cmd); dr.Read(); x = dr.GetInt32(0); x++; string staffid = "STAFF" + x.ToString(); txt1.Text = staffid; cmd.Parameters.AddWithValue("@staffid", txt1.Text); Session["staffid"] = txt1.Text; txt8.Text = staffid + "*****@*****.**"; if (!IsPostBack) { DropDownList1.Items.Add("current post"); DropDownList1.Items.Add("RM"); DropDownList1.Items.Add("AM"); DropDownList1.Items.Add("PMR"); DropDownList1.Items.Add("OFFICE ASSISTENT"); } }
protected void Page_Load(object sender, EventArgs e) { dbcon db = new dbcon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select t_id from KEY_GEN"; SqlDataReader dr = db.executeread(cmd); dr.Read(); x = dr.GetInt32(0); x++; string t_id = "TARGET" + x.ToString(); TextBox1.Text = t_id; dbcon db1 = new dbcon(); DropDownList3.Items.Add("select PRODUCT"); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select distinct p_name from product_tbl"; SqlDataReader dr1 = db1.executeread(cmd1); while (dr1.Read()) { DropDownList3.Items.Add(dr1.GetString(0)); } }
protected void Page_Load(object sender, EventArgs e) { dbcon db = new dbcon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SELECT staffid,s_name,image,Convert(varchar(11),dob,120) dob,sex,addrs,phone, desgn,Convert(varchar(11),dob,120) doj,email,cemail,status from staff_tbl WHERE desgn='AM'"; SqlDataReader dr = db.executeread(cmd); DataList1.DataSource = dr; DataList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { dbcon db1 = new dbcon(); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select req_id,pmr_id,pname,type,need,status from pmr_req"; SqlDataReader dr = db1.executeread(cmd1); DataList1.DataSource = dr; DataList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { dbcon db = new dbcon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select *from dr_visit_tbl order by pmr_id"; SqlDataReader dr = db.executeread(cmd); DataList1.DataSource = dr; DataList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { dbcon db1 = new dbcon(); DropDownList1.Items.Add("select type"); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select * from pack_tbl"; SqlDataReader dr1 = db1.executeread(cmd1); while (dr1.Read()) { DropDownList1.Items.Add(dr1.GetString(0) + " - " + dr1.GetString(1)); } }
protected void Page_Load(object sender, EventArgs e) { dbcon db = new dbcon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select stateid from key_gen"; SqlDataReader dr = db.executeread(cmd); dr.Read(); x = dr.GetInt32(0); x++; string stateid = "STATE" + x.ToString(); txt1.Text = stateid; }
protected void Page_Load(object sender, EventArgs e) { dbcon db = new dbcon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select pack_id from KEY_GEN"; SqlDataReader dr = db.executeread(cmd); dr.Read(); x = dr.GetInt32(0); x++; string pack_id = "PACK" + x.ToString(); txt1.Text = pack_id; }
protected void Page_Load(object sender, EventArgs e) { dbcon db = new dbcon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select dr_id from KEY_GEN"; SqlDataReader dr = db.executeread(cmd); dr.Read(); x = dr.GetInt32(0); x++; string dr_id = "DR" + x.ToString(); txt1.Text = dr_id; if (!IsPostBack) { ddl1.Items.Add("---Select state---"); dbcon db1 = new dbcon(); ddl2.Items.Add("Select district"); SqlCommand cmd1 = new SqlCommand(); cmd1.CommandText = "select distinct state_name from state_tbl"; SqlDataReader dr1 = db1.executeread(cmd1); while (dr1.Read()) { ddl1.Items.Add(dr1.GetString(0).ToString()); } ddl2.Items.Add("Select district"); dbcon db2 = new dbcon(); SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "select distinct district from state_tbl"; SqlDataReader dr2 = db2.executeread(cmd2); while (dr2.Read()) { ddl2.Items.Add(dr2.GetString(0).ToString()); } } }
protected void btn1_Click(object sender, EventArgs e) { dbcon db = new dbcon(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select * from login_tbl where userID=@uid and pwd=@pwd"; cmd.Parameters.AddWithValue("@uid", Txt1.Text); Session["uid"] = Txt1.Text; cmd.Parameters.AddWithValue("@pwd", Txt2.Text); SqlDataReader dr = db.executeread(cmd); dr.Read(); type = dr.GetString(2); if (type == "CEO") { Response.Redirect("ADMIN_HOME.aspx"); } else if (type == "RM") { Response.Redirect("RM_HOME.aspx"); } else if (type == "AM") { Response.Redirect("AMHOME.aspx"); } else if (type == "PMR") { Response.Redirect("PMRHOME.aspx"); } else if (type == "OA") { Response.Redirect("OAHOME.aspx"); } }