protected void ddlProductType_SelectedIndexChanged(object sender, EventArgs e) { try { if (cboSearchType0.SelectedValue == "0" || cboSearchType0.SelectedValue == "") { cboSearchType0.SelectedValue = "1"; } DateTime date; if (DropDownList1.SelectedValue == "0" || DropDownList1.SelectedValue == "") { date = DateTime.Parse("June/1/2014 "); } else { date = DateTime.Parse(DropDownList1.SelectedValue); } ddlProduct.DataSource = dh.GetProductById(int.Parse(cboSearchType0.SelectedValue)); ddlProduct.DataValueField = "ItemCode"; ddlProduct.DataTextField = "Description"; ddlProduct.DataBind(); DataGrid3.DataSource = dh.GetItemsReport(int.Parse(cboSearchType0.SelectedValue), date); DataGrid3.DataBind(); Label5.Text = "Sales for : " + cboSearchType0.SelectedItem.ToString(); } catch (Exception ex) { Message(ex.Message, true); } }
protected void BindGrid3() { if (!this.IsPostBack) { string constr = ConfigurationManager.ConnectionStrings["WebAppConnString"].ConnectionString; using (MySqlConnection con = new MySqlConnection(constr)) { using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM database.activite WHERE activite.iduser='******' AND activite.nature='Travail, réparation, rénovation'")) { using (MySqlDataAdapter sda = new MySqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); DataGrid3.DataSource = dt; DataGrid3.DataBind(); } } } } } }
protected void Page_Load(object sender, EventArgs e) { using (SqlConnection connect = new SqlConnection("server=DESKTOP-NOQ9PCB\\MSSQLSERVER01;database=DxcTraining; integrated security=true")) { SqlDataAdapter sda = new SqlDataAdapter("select * from student1", connect); DataSet ds = new DataSet(); sda.Fill(ds); DataGrid1.DataSource = ds; DataGrid1.DataBind(); SqlDataAdapter sda1 = new SqlDataAdapter("select * from Employee2", connect); DataSet ds1 = new DataSet(); sda1.Fill(ds1); DataGrid2.DataSource = ds1; DataGrid2.DataBind(); SqlDataAdapter sda2 = new SqlDataAdapter("select * from IndianCricketTeam", connect); DataSet ds2 = new DataSet(); sda2.Fill(ds2); DataGrid3.DataSource = ds2; DataGrid3.DataBind(); SqlDataAdapter sda3 = new SqlDataAdapter("select * from IndianRailwaySystem1 ", connect); DataSet ds3 = new DataSet(); sda3.Fill(ds3); DataGrid4.DataSource = ds3; DataGrid4.DataBind(); SqlDataAdapter sda4 = new SqlDataAdapter("select * from BankTable", connect); DataSet ds4 = new DataSet(); sda4.Fill(ds4); DataGrid5.DataSource = ds4; DataGrid5.DataBind(); } }
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e) { id = e.Item.Cells[0].Text; if (e.CommandName == "su") { MultiView1.SetActiveView(View2); DataGrid2.DataSource = db.DataReturn("select * from surgeons where hospital_id='" + id + "'"); DataGrid2.DataBind(); } if (e.CommandName == "sr") { MultiView1.SetActiveView(View3); DataGrid3.DataSource = db.DataReturn("select * from surgeries inner join surgery_category on.surgeries.category_id=surgery_category.category_id where hospital_id='" + id + "'"); DataGrid3.DataBind(); } if (e.CommandName == "a") { string qry = "update login set user_type='hospital' where login_id='" + e.Item.Cells[1].Text + "'"; db.DataNonReturn(qry); Response.Write("<script>alert('Approved Successfully !!!');window.location='admin_hospitals.aspx'</script>"); } if (e.CommandName == "r") { string qry = "update login set user_type='Rejected' where login_id='" + e.Item.Cells[1].Text + "'"; db.DataNonReturn(qry); Response.Write("<script>alert('Rejected Successfully !!!');window.location='admin_hospitals.aspx'</script>"); } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList1.SelectedItem.Text == "Food") { MultiView1.SetActiveView(View2); cmd.CommandText = "select *from food_tb"; DataGrid1.DataSource = db.getdata(cmd); DataGrid1.DataBind(); } else if (DropDownList1.SelectedItem.Text == "Hotel") { MultiView1.SetActiveView(View3); cmd.CommandText = "select *from Hotel_tb"; DataGrid2.DataSource = db.getdata(cmd); DataGrid2.DataBind(); } else if (DropDownList1.SelectedItem.Text == "Place") { MultiView1.SetActiveView(View4); cmd.CommandText = "select *from Place_tb"; DataGrid3.DataSource = db.getdata(cmd); DataGrid3.DataBind(); } else if (DropDownList1.SelectedItem.Text == "Others") { MultiView1.SetActiveView(View5); cmd.CommandText = "select *from Image_tb"; DataGrid4.DataSource = db.getdata(cmd); DataGrid4.DataBind(); } }
protected void Grid_PageIndexChanged(object source, DataGridPageChangedEventArgs e) { DataGrid3.CurrentPageIndex = e.NewPageIndex; if (!this.IsPostBack) { string constr = ConfigurationManager.ConnectionStrings["WebAppConnString"].ConnectionString; using (MySqlConnection con = new MySqlConnection(constr)) { using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM database.titre WHERE titre.codeuser="******"urole"] + " AND titre.numzone='C21' UNION SELECT * FROM database.detail WHERE detail.codeuser="******"urole"] + " AND detail.numzone='C21' ")) { using (MySqlDataAdapter sda = new MySqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); DataGrid3.DataSource = dt; DataGrid3.DataBind(); } } } } } }
protected void Page_Load(object sender, EventArgs e) { //Establish the database connection using (SqlConnection Connect = new SqlConnection("data source=.;database=assignment;integrated security= SSPI")) { SqlDataAdapter SDA = new SqlDataAdapter("Select * from students", Connect); //to retrive the data from database- student created SqlDataAdapter SDA1 = new SqlDataAdapter("Select * from Employee", Connect); //to retrive the data from database- student created SqlDataAdapter SDA2 = new SqlDataAdapter("Select * from CricketTeam", Connect); //to retrive the data from database- student created SqlDataAdapter SDA3 = new SqlDataAdapter("Select * from IRS", Connect); //to retrive the data from database- student created SqlDataAdapter SDA4 = new SqlDataAdapter("Select * from Bank_EmployeeDetails", Connect); //to retrive the data from database- student created DataSet ds = new DataSet(); //to convert the data into the grid. DataSet ds1 = new DataSet(); //to convert the data into the grid. DataSet ds2 = new DataSet(); //to convert the data into the grid. DataSet ds3 = new DataSet(); //to convert the data into the grid. DataSet ds4 = new DataSet(); //to convert the data into the grid. SDA.Fill(ds); SDA1.Fill(ds1); SDA2.Fill(ds2); SDA3.Fill(ds3); SDA4.Fill(ds4); DataGrid1.DataSource = ds; DataGrid1.DataBind(); DataGrid2.DataSource = ds1; DataGrid2.DataBind(); DataGrid3.DataSource = ds2; DataGrid3.DataBind(); DataGrid4.DataSource = ds3; DataGrid4.DataBind(); DataGrid5.DataSource = ds4; DataGrid5.DataBind(); } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { try { DataGrid3.DataSource = dh.GetItemsReport(int.Parse(cboSearchType0.SelectedValue), DateTime.Parse(DropDownList1.SelectedValue)); DataGrid3.DataBind(); } catch (Exception ex) { Message(ex.Message, true); } }
protected void DeluxePager1_CommonPageIndexChanged(object sender, EventArgs e) { DataSet ds = ObjData.GetPagerList(DeluxePager1.PageSize, DeluxePager1.PageIndex); int recordCount = ObjData.GetOrdersCount(); DeluxePager1.RecordCount = recordCount; DataGrid3.DataSource = ds; DataGrid3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "select max(rid) from rating"; id = a.max_id(cmd); cmd.CommandText = "SELECT auditorium.aid,auditorium.aname, auditorium.location, auditorium.cont_no, auditorium.email, auditorium.image, rating.rating FROM auditorium INNER JOIN rating ON auditorium.aid = rating.aid "; DataGrid3.DataSource = a.getdata(cmd); DataGrid3.DataBind(); MultiView1.SetActiveView(View10); } }
private void InitializePagers() { DeluxePager1.PageIndex = 0; DataSet ds = ObjData.GetPagerList(DeluxePager1.PageSize, DeluxePager1.PageIndex); int recordCount = ObjData.GetOrdersCount(); DeluxePager1.RecordCount = recordCount; DataGrid3.DataSource = ds; DataGrid3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SELECT bookingreg.bid, user_reg.name, bookingreg.fr_date, bookingreg.to_date, bookingreg.time, package.package, bookingreg.total_amt FROM bookingreg INNER JOIN user_reg ON bookingreg.uid = user_reg.uid INNER JOIN package ON bookingreg.pkg_id = package.pgid and bookingreg.aid=" + Session["id"] + ""; DataGrid2.DataSource = a.getdata(cmd); DataGrid2.DataBind(); cmd.CommandText = "SELECT hour_booking.hid, user_reg.name, hour_booking.date, hour_booking.start_time, hour_booking.end_time, hour_booking.amount FROM hour_booking INNER JOIN user_reg ON hour_booking.uid = user_reg.uid and hour_booking.aid=" + Session["id"] + ""; DataGrid3.DataSource = a.getdata(cmd); DataGrid3.DataBind(); MultiView1.SetActiveView(View1); } }
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e) { id = e.Item.Cells[0].Text; if (e.CommandName == "su") { MultiView1.SetActiveView(View2); DataGrid2.DataSource = db.DataReturn("select * from surgeons where hospital_id='" + id + "'"); DataGrid2.DataBind(); } if (e.CommandName == "sr") { MultiView1.SetActiveView(View3); DataGrid3.DataSource = db.DataReturn("select surgeries.*,surgery_category.*,surgeons.first_name+' '+surgeons.last_name as sname from surgeries inner join surgery_category on.surgeries.category_id=surgery_category.category_id inner join surgeons on surgeons.surgeon_id=surgeries.surgeon_id where surgeries.hospital_id='" + id + "'"); DataGrid3.DataBind(); } }
private void getdata4(string sql) { DataSet result = new DataSet(); result = new Class1().hsggetdata(sql); if (result != null) { if (result.Tables[0].Rows.Count > 0) { DataGrid3.DataSource = result.Tables[0]; DataGrid3.DataBind(); } else { DataGrid3.DataSource = null; DataGrid3.DataBind(); } } }
private void defaultvalue() { DateTime date; if (DropDownList1.SelectedValue == "0" || DropDownList1.SelectedValue == "") { date = DateTime.Parse("June/1/2014 "); } else { date = DateTime.Parse(DropDownList1.SelectedValue); } ddlProduct.DataSource = dh.GetProductById(int.Parse(cboSearchType0.SelectedValue)); ddlProduct.DataValueField = "ItemCode"; ddlProduct.DataTextField = "Description"; ddlProduct.DataBind(); DataGrid3.DataSource = dh.GetItemsReport(int.Parse(cboSearchType0.SelectedValue), date); DataGrid3.DataBind(); Label5.Text = "Sales for : " + cboSearchType0.SelectedItem.ToString(); }
public void BindData3() { SqlDataAdapter da; DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand(); SqlConnection con; con = new SqlConnection(connetionString); cmd.CommandText = "SELECT a.SectorName, a.StockPrice, a.StockQuantity, a.CompanyName" + " FROM dbo.StockMarket a"; // + " INNER JOIN dbo.Sectors s ON a.Sector=s.Sector" // + " INNER JOIN dbo.Company c ON a.Company=c.Company"; cmd.Connection = con; da = new SqlDataAdapter(cmd); da.Fill(ds); con.Open(); cmd.ExecuteNonQuery(); DataGrid3.DataSource = ds; DataGrid3.DataBind(); con.Close(); }
private void AHPDataBinding(int ver_id, int estterm_ref_id, int est_dept_ref_id) { Biz_PDTAndAHPStgEstDeptDatas pdtAhpStgEstDept = new Biz_PDTAndAHPStgEstDeptDatas(); DataGrid1.DataSource = pdtAhpStgEstDept.GetAHPEstDeptStgList(ver_id , estterm_ref_id , est_dept_ref_id); DataGrid1.DataBind(); DataTable dt = GetAHPPointDataTable(); if (dt != null) { DataGrid3.DataSource = dt; DataGrid3.DataBind(); DataGrid3.Visible = true; GraphAvailablePointBinding(dt); pdtAhpStgEstDept.ModifyPDTAndAHPWeight(VER_ID , ESTTERM_REF_ID , int.Parse(txtDeptID.Text) , EMP_REF_ID , dt); } else { lblCI.Text = "0"; lblCR.Text = "0"; lblMsg.Text = ""; //DataGrid3.Visible = false; //GraphNullPointBinding(); } }
protected void BindData() { if (!this.IsPostBack) { string constr = ConfigurationManager.ConnectionStrings["WebAppConnString"].ConnectionString; using (MySqlConnection con = new MySqlConnection(constr)) { using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM database.titre WHERE titre.codeuser='******' AND titre.numzone='C21' UNION SELECT * FROM database.detail WHERE detail.codeuser='******' AND detail.numzone='C21' ")) { using (MySqlDataAdapter sda = new MySqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); DataGrid3.DataSource = dt; DataGrid3.DataBind(); } } } } } }
private void MenuRestartChecked_Click(object sender, RoutedEventArgs e) { var list = DataGrid3.GetCheckedArchors(); archorManager.Reset(list.ToArray()); }
protected void Cargar_Tabla_Rtns(object sender, EventArgs e) { if (numdig.Text != "" && Convert.ToInt32(dig.Text) != Convert.ToInt32(numdig.Text)) { dig.Text = numdig.Text; dig.Visible = true; dt = new DataTable(); dt.Columns.Add(new DataColumn("Nombre", typeof(string))); dt.Columns.Add(new DataColumn("Nit", typeof(string))); for (int i = 0; i < Convert.ToInt32(numdig.Text); i++) { DataRow fila = dt.NewRow(); dt.Rows.Add(fila); } DataGrid1.DataSource = dt; DataGrid1.DataBind(); DataGrid1.Visible = true; } if (numpat.Text != "" && Convert.ToInt32(pat.Text) != Convert.ToInt32(numpat.Text)) { pat.Text = numpat.Text; pat.Visible = true; numeropat = Convert.ToInt32(numpat.Text); dt = new DataTable(); dt.Columns.Add(new DataColumn("Nombre", typeof(string))); dt.Columns.Add(new DataColumn("Nit", typeof(string))); for (int i = 0; i < Convert.ToInt32(numpat.Text); i++) { DataRow fila = dt.NewRow(); dt.Rows.Add(fila); } DataGrid2.DataSource = dt; DataGrid2.DataBind(); DataGrid2.Visible = true; } if (numcont.Text != "" && Convert.ToInt32(cont.Text) != Convert.ToInt32(numcont.Text)) { cont.Text = numcont.Text; cont.Visible = true; numerocont = Convert.ToInt32(numcont.Text); dt = new DataTable(); dt.Columns.Add(new DataColumn("Nombre", typeof(string))); dt.Columns.Add(new DataColumn("Nit", typeof(string))); for (int i = 0; i < Convert.ToInt32(numcont.Text); i++) { DataRow fila = dt.NewRow(); dt.Rows.Add(fila); } DataGrid3.DataSource = dt; DataGrid3.DataBind(); DataGrid3.Visible = true; } if (numcor.Text != "" && Convert.ToInt32(cor.Text) != Convert.ToInt32(numcor.Text)) { cor.Text = numcor.Text; cor.Visible = true; numerocor = Convert.ToInt32(numcor.Text); dt = new DataTable(); dt.Columns.Add(new DataColumn("Nombre", typeof(string))); dt.Columns.Add(new DataColumn("Nit", typeof(string))); for (int i = 0; i < Convert.ToInt32(numcor.Text); i++) { DataRow fila = dt.NewRow(); dt.Rows.Add(fila); } DataGrid4.DataSource = dt; DataGrid4.DataBind(); DataGrid4.Visible = true; } }
protected void LoadInitData(string prefInventario, string numInventario) { string sql = String.Format( "SELECT mrol.prinf_codigo AS Rol, \n" + " MNI.mnit_nit AS Nit, \n" + " MNI.mnit_nombres concat ' ' concat COALESCE(MNI.mnit_nombre2,' ') concat ' ' concat MNI.mnit_apellidos concat ' ' concat COALESCE(MNI.mnit_apellido2,' ') AS Nombre \n" + "FROM mrolinventariofisico mrol \n" + " LEFT JOIN mnit MNI ON mrol.mnit_nit = MNI.mnit_nit \n" + "WHERE pdoc_codigo = '{0}' \n" + "AND minf_numeroinf = {1}" , prefInventario , numInventario); DataSet ds = new DataSet(); DataTable dtGerente = new DataTable(); DataTable dtAuditor = new DataTable(); DataTable dtDigitadores = new DataTable(); DataTable dtPatinadores = new DataTable(); DataTable dtCoordinadores = new DataTable(); DataTable dtContadores = new DataTable(); dtGerente.Columns.Add(new DataColumn("Rol", typeof(string))); dtGerente.Columns.Add(new DataColumn("Nit", typeof(string))); dtGerente.Columns.Add(new DataColumn("Nombre", typeof(string))); dtAuditor.Columns.Add(new DataColumn("Rol", typeof(string))); dtAuditor.Columns.Add(new DataColumn("Nit", typeof(string))); dtAuditor.Columns.Add(new DataColumn("Nombre", typeof(string))); dtDigitadores.Columns.Add(new DataColumn("Rol", typeof(string))); dtDigitadores.Columns.Add(new DataColumn("Nit", typeof(string))); dtDigitadores.Columns.Add(new DataColumn("Nombre", typeof(string))); dtPatinadores.Columns.Add(new DataColumn("Rol", typeof(string))); dtPatinadores.Columns.Add(new DataColumn("Nit", typeof(string))); dtPatinadores.Columns.Add(new DataColumn("Nombre", typeof(string))); dtCoordinadores.Columns.Add(new DataColumn("Rol", typeof(string))); dtCoordinadores.Columns.Add(new DataColumn("Nit", typeof(string))); dtCoordinadores.Columns.Add(new DataColumn("Nombre", typeof(string))); dtContadores.Columns.Add(new DataColumn("Rol", typeof(string))); dtContadores.Columns.Add(new DataColumn("Nit", typeof(string))); dtContadores.Columns.Add(new DataColumn("Nombre", typeof(string))); ds = DBFunctions.Request(ds, IncludeSchema.NO, sql); foreach (DataRow dr in ds.Tables[0].Select("ROL=1")) { dtGerente.Rows.Add(dr.ItemArray); } foreach (DataRow dr in ds.Tables[0].Select("ROL=2")) { dtAuditor.Rows.Add(dr.ItemArray); } foreach (DataRow dr in ds.Tables[0].Select("ROL=3")) { dtDigitadores.Rows.Add(dr.ItemArray); } foreach (DataRow dr in ds.Tables[0].Select("ROL=4")) { dtPatinadores.Rows.Add(dr.ItemArray); } foreach (DataRow dr in ds.Tables[0].Select("ROL=5")) { dtCoordinadores.Rows.Add(dr.ItemArray); } foreach (DataRow dr in ds.Tables[0].Select("ROL=6")) { dtContadores.Rows.Add(dr.ItemArray); } if (dtGerente.Rows.Count > 0) { DataRow drGerente = dtGerente.Rows[0]; TextBox1.Text = drGerente["NOMBRE"].ToString(); TextBox1a.Value = drGerente["NIT"].ToString(); } if (dtAuditor.Rows.Count > 0) { DataRow drAuditor = dtAuditor.Rows[0]; TextBox2.Text = drAuditor["NOMBRE"].ToString(); TextBox2a.Value = drAuditor["NIT"].ToString(); } DataGrid1.DataSource = dtDigitadores; DataGrid2.DataSource = dtPatinadores; DataGrid3.DataSource = dtCoordinadores; DataGrid4.DataSource = dtContadores; DataGrid1.Visible = dtDigitadores.Rows.Count > 0; DataGrid2.Visible = dtPatinadores.Rows.Count > 0; DataGrid3.Visible = dtCoordinadores.Rows.Count > 0; DataGrid4.Visible = dtContadores.Rows.Count > 0; DataGrid1.DataBind(); DataGrid2.DataBind(); DataGrid3.DataBind(); DataGrid4.DataBind(); dig.Text = numdig.Text = dtDigitadores.Rows.Count.ToString(); pat.Text = numpat.Text = dtPatinadores.Rows.Count.ToString(); cont.Text = numcont.Text = dtCoordinadores.Rows.Count.ToString(); cor.Text = numcor.Text = dtContadores.Rows.Count.ToString(); }