protected void Page_Load(object sender, EventArgs e) { DataView dv = (DataView)SqlDataSource2.Select(DataSourceSelectArguments.Empty); foreach (DataRowView drv in dv) { DataRow dr = drv.Row; lblAccountNo.Text = dr["accountNo"].ToString(); lblMatrixNo.Text = dr["matricNo"].ToString(); lblName.Text = dr["name"].ToString(); } }
protected void Button1_Click(object sender, EventArgs e) { try { SqlDataSource2.Insert(); Label9.Text = "Dossier est Ajouté avec succes"; } catch (Exception e1) { Label9.Text = e1.Message; } }
protected void Button1_Click(object sender, EventArgs e) { //SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["WY-FADBConnectionString"].ConnectionString); //SqlDataAdapter objda = new SqlDataAdapter("select * from users where uid='" + TextBox1.Text + "'", conn); //SqlDataSource2.ConnectionString = "Data Source=williamsphere-z;Initial Catalog=FADB;Integrated Security=True"; //SqlDataSource2.SelectCommand = "select * from users where uid='" + TextBox1.Text + "'"; //DetailsView1.DataSourceID = "SqlDataSource12"; //DetailsView1.DataBind(); SqlDataSource2.DataBind(); GridView1.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { if (IsValid) { SqlDataSource2.InsertParameters["Nom_Prod"].DefaultValue = TextBox1.Text; } SqlDataSource2.InsertParameters["Desc_Prod"].DefaultValue = TextBox2.Text; SqlDataSource2.Insert(); Label4.Text = "Se efectuó la carga"; TextBox1.Text = ""; TextBox2.Text = ""; }
protected void btn2_Click(object sender, EventArgs e) { foreach (ListItem li in CheckBoxList1.Items) { if (li.Selected == true) { String sql = "update InwardLetters set InwardStatus=True WHERE InwardNo='" + li.Text + "'"; SqlDataSource2.UpdateCommand = sql; int n = SqlDataSource2.Update(); } } }
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text == "") { Button1.Enabled = false; } //try //{ // int RecieptNo = 0; // coon.Open(); // Response.Write("<script>alert('connection opende');</script>"); // string query = "SELECT MAX(Payment_ReceiptNo)+1 FROM tblpayment"; // OdbcCommand cmd2 = new OdbcCommand(query, coon); // cmd2.CommandType = CommandType.Text; // OdbcDataReader dr = cmd2.ExecuteReader(); // while (dr.Read()) // { // RecieptNo = Convert.ToInt32(dr[0].ToString()); // } // string da1 = "INSERT INTO Payment_ReceiptNo(Payment_ReceiptNo) VALUES( '" + RecieptNo + "')"; // OdbcCommand cmd1 = new OdbcCommand(da1, coon); // cmd1.ExecuteNonQuery(); //string da = "INSERT INTO tbladvertisement(Res_Code,Payment_ReceiptNo,star_date,end_date,special_description) VALUES( '" + DropDownList1.SelectedValue.ToString() + "','" + RecieptNo + "','" + Calendar1.SelectedDate.ToString() + "','" + Calendar2.SelectedDate.ToString() + "','" + DropDownList2.SelectedItem.Value + "')"; //OdbcCommand cmd = new OdbcCommand(da, coon); //cmd.ExecuteNonQuery(); //Response.Write("<script>alert('Thank you for rating us');</script>"); //coon.Close(); SqlDataSource2.Insert(); lblpost.Text = "Thank you!!! Your advertisement will apear soon"; lblpost.Visible = true; //} //catch (OdbcException od) //{ // Response.Write(od.ToString()); // coon.Close(); //} }
private void tableMeta() { dt = new DataTable(); SqlConnection con = new SqlConnection(strConnString); con.Open(); string result2 = SqlDataSource2.SelectCommand = "SELECT TOP (1000) seccion, Meta, Avance, Faltante, AvancePorciento, FaltantePorciento FROM solaris.dbo.Meta_Territorio"; SqlDataSource2.DataBind(); con.Close(); }
protected void Page_Load(object sender, EventArgs e) { hfStatus.Value = "No"; hfStatus2.Value = "No"; int n = SqlDataSource1.Update(); if (n == 1) { SqlDataSource2.Update(); Response.Write("<script>alert('User Cancelled Successfully..')</script>"); } Server.Transfer("RoomDetails.aspx"); }
void CadastrarUser() { string password = txtSenha.Text; SqlDataSource2.InsertParameters["Login"].DefaultValue = txtLogin.Text; SqlDataSource2.InsertParameters["Senha"].DefaultValue = password; SqlDataSource2.InsertParameters["Cond"].DefaultValue = ddlCond.SelectedValue; SqlDataSource2.InsertParameters["Bloco"].DefaultValue = ddlBloco.SelectedValue; SqlDataSource2.InsertParameters["Apart"].DefaultValue = ddlApart.SelectedValue; SqlDataSource2.InsertParameters["Nome"].DefaultValue = txtNome.Text; SqlDataSource2.Insert(); }
private void LearnerLab() { string command = SqlDataSource2.SelectCommand; SqlDataSource2.SelectCommand = "SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, TECHNOPARK.QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.LEARNER.PHONE, TECHNOPARK.LEARNER.INTERESTS, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM TECHNOPARK.LEARNER INNER JOIN TECHNOPARK.QUEUE ON TECHNOPARK.LEARNER.ID_LEARNER = TECHNOPARK.QUEUE.ID_LEARNER_Q INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_STATUS_LEARNER ON TECHNOPARK.QUEUE.ID_STATUS_L = TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER WHERE (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER =1) and TECHNOPARK.DIR_LABORATORIES.LABORATORY = '" + DropDownList2.Text + "'"; //SqlDataSource2.SelectCommand = "SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, TECHNOPARK.QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM (SELECT ID_LEARNER_Q AS ID_l, ID_QUEUE FROM QUEUE WHERE ID_STATUS_L = 2 OR ID_STATUS_L = 10) A, TECHNOPARK.LEARNER INNER JOIN TECHNOPARK.QUEUE ON TECHNOPARK.LEARNER.ID_LEARNER = TECHNOPARK.QUEUE.ID_LEARNER_Q INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_STATUS_LEARNER ON TECHNOPARK.QUEUE.ID_STATUS_L = TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER WHERE(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 2) AND(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 6) AND(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 7) AND(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 8) AND(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 10) and TECHNOPARK.DIR_LABORATORIES.LABORATORY = '" + DropDownList2.Text + "' and ID_LEARNER!= 0 AND QUEUE.ID_QUEUE != 0 AND A.ID_QUEUE = QUEUE.ID_QUEUE AND LEARNER.ID_LEARNER<> A.ID_l"; //SqlDataSource2.SelectCommand = "SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, TECHNOPARK.QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM TECHNOPARK.LEARNER INNER JOIN TECHNOPARK.QUEUE ON TECHNOPARK.LEARNER.ID_LEARNER = TECHNOPARK.QUEUE.ID_LEARNER_Q INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_STATUS_LEARNER ON TECHNOPARK.QUEUE.ID_STATUS_L = TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER WHERE (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 2) AND (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 6) AND (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 7) AND (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 8) AND (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 10) and TECHNOPARK.DIR_LABORATORIES.LABORATORY = '" + DropDownList2.Text + "' and ID_LEARNER!=0 AND ID_QUEUE!=0"; SqlDataSource2.DataBind(); GridView1.DataBind(); //oraConnection.Close(); Label9.Visible = true; Label9.Text = "Список обучающихся по выбранному проекту"; }
protected void DropDownList7_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList6.Text == "") { } else { int idTtienda = 0; idTtienda = Convert.ToInt32(Session["IDtienda"]); SqlDataSource2.SelectCommand = "SELECT Producto.Codigo, Producto.Codigo2, Producto.Descripcion AS Producto,MarcaProd.MarcaP, Rubro.Rubro, Modelo.Modelo, Marca.Marca, Anio.Anio, Stock.Cantidad, Stock.Ubicacion, Stock.PrecioUnitario, Stock.PrecioVenta, Stock.ID_Existencia, Medida.Medida FROM Anio INNER JOIN Stock INNER JOIN Producto ON Stock.Codigo = Producto.Codigo ON Anio.ID_Anio = Stock.ID_Anio INNER JOIN Rubro ON Producto.ID_Rubro = Rubro.ID_Rubro INNER JOIN Marca INNER JOIN Modelo ON Marca.ID_Marca = Modelo.ID_Marca ON Rubro.ID_Modelo = Modelo.ID_Modelo INNER JOIN MarcaProd ON Producto.ID_MaraProd = MarcaProd.ID_MaraProd INNER JOIN Medida on Stock.ID_Medida = Medida.ID_Medida Where (Producto.Estado = 1) AND Rubro.ID_Rubro = " + DropDownList6.SelectedValue + " AND Anio.ID_Anio = " + DropDownList7.SelectedValue + "AND Stock.ID_Tienda = " + idTtienda; SqlDataSource2.DataBind(); } }
protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e) { SqlDataSource2.UpdateParameters["Ingredient_id"].DefaultValue = e.CommandArgument.ToString(); SqlDataSource2.UpdateParameters["Ingredient_measure_unit"].DefaultValue = ((TextBox)e.Item.FindControl("Ingredient_measure_unitTextBox")).Text; SqlDataSource2.UpdateParameters["Ingredient_quantity"].DefaultValue = ((TextBox)e.Item.FindControl("Ingredient_quantityTextBox")).Text; SqlDataSource2.UpdateParameters["Ingredient_name"].DefaultValue = ((TextBox)e.Item.FindControl("Ingredient_nameTextBox")).Text; SqlDataSource2.Update(); DataList1.EditItemIndex = -1; DataList1.DataBind(); }
protected void DeleteComment_Click(object sender, EventArgs e) { try { SqlDataSource2.Delete(); MultiView1.ActiveViewIndex = 0; btnRead.Enabled = false; } catch { MultiView1.ActiveViewIndex = 0; } }
protected void Button2_Click(object sender, EventArgs e) { SqlDataSource2.InsertParameters["nomTema"].DefaultValue = TextBox5.Text; SqlDataSource2.InsertParameters["desTema"].DefaultValue = TextBox6.Text; SqlDataSource2.InsertParameters["fuenteTema"].DefaultValue = TextBox7.Text; SqlDataSource2.InsertParameters["linkTema"].DefaultValue = TextBox8.Text; SqlDataSource2.Insert(); Label1.Text = "Se efectuó la carga"; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; }
protected void Button1_Click(object sender, EventArgs e) { try { SqlDataSource2.Insert(); Label8.Text = "Tarea insertada correctamente"; Button1.Enabled = false; } catch (Exception ex) { Label8.Text = "Código repetido."; } }
protected void btnZapiszPrzedmiot_Click(object sender, EventArgs e) { SqlDataSource2.InsertCommandType = SqlDataSourceCommandType.Text; SqlDataSource2.InsertCommand = "Insert into Przedmioty (nazwa,ile_godzin,typ_zajec,semestr,Specjalnosc_id_specjalnosc) VALUES (@nazwa,@ile_godzin,@typ_zajec,@semestr,@Specjalnosc_id_specjalnosc)"; SqlDataSource2.InsertParameters.Clear(); SqlDataSource2.InsertParameters.Add("nazwa", tbNazwaPrzedmiot.Text); SqlDataSource2.InsertParameters.Add("ile_godzin", tbIleGodzinPrzedmiot.Text); SqlDataSource2.InsertParameters.Add("typ_zajec", tbTypZajecPrzedmiot.Text); SqlDataSource2.InsertParameters.Add("semestr", tbSemestrPrzedmiot.Text); SqlDataSource2.InsertParameters.Add("Specjalnosc_id_specjalnosc", ddlPrzedmiotSpecjalizacja.SelectedValue.ToString()); SqlDataSource2.Insert(); pDodajPrzedmiot.Visible = false; }
protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e) { string orderno = ((Label)e.Item.FindControl("Label1")).Text; string commissionamount = ((Label)e.Item.FindControl("Label6")).Text; if (e.CommandName == "received") { SqlDataSource2.UpdateParameters.Add("Commissionreceived", commissionamount); SqlDataSource2.UpdateParameters.Add("OrderNo", orderno); SqlDataSource2.Update(); } }
protected void cat_SelectedIndexChanged(object sender, EventArgs e) { switch (cat.SelectedValue) { case "Select a value...": SqlDataSource2.SelectCommand = ""; dest.DataSourceID = ""; SqlDataSource2.DataBind(); dest.DataBind(); break; case "Hospital": SqlDataSource2.SelectCommand = "SELECT * FROM hospital"; dest.DataSourceID = "SqlDataSource2"; dest.DataTextField = "hos_name"; dest.DataValueField = "hos_id"; SqlDataSource2.DataBind(); dest.DataBind(); hosp.Visible = true; dia.Visible = false; pharm.Visible = false; break; case "Diagnostic": SqlDataSource2.SelectCommand = "SELECT * FROM diagnostic"; dest.DataSourceID = "SqlDataSource2"; dest.DataTextField = "diag_name"; dest.DataValueField = "diag_id"; SqlDataSource2.DataBind(); dest.DataBind(); hosp.Visible = false; dia.Visible = true; pharm.Visible = false; break; case "Pharmacy": SqlDataSource2.SelectCommand = "SELECT * FROM pharmacy"; dest.DataSourceID = "SqlDataSource2"; dest.DataTextField = "pharma_name"; dest.DataValueField = "pharma_id"; SqlDataSource2.DataBind(); dest.DataBind(); hosp.Visible = false; dia.Visible = false; pharm.Visible = true; break; default: break; } }
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text != "") { //string command = SqlDataSource1.SelectCommand; SelectGroupt(); Label2.Visible = true; Label4.Visible = true; DropDownList1.Visible = true; Button3.Visible = true; Label11.Visible = true; Label12.Visible = true; Button2.Visible = true; Label3.Visible = true; GridView2.Visible = true; DropDownList2.Visible = true; } else { if (Class_FIO.Employees_position == "2") { string command = SqlDataSource1.SelectCommand; SqlDataSource1.SelectCommand = "SELECT TECHNOPARK.GROUPS.TITLE, TECHNOPARK.EMPLOYEES.FIO, TECHNOPARK.DIR_PROJECTS.TITLE AS EXPR1, TECHNOPARK.GROUPS.D_START, TECHNOPARK.GROUPS.D_END, TECHNOPARK.GROUPS.D_CONFERENCE, TECHNOPARK.GROUPS.TIME_CLASS, TECHNOPARK.GROUPS.PROJECT_THEME, TECHNOPARK.DIR_STATUS_GROUP.STATUS_G, TECHNOPARK.GROUPS.ID_GROUPT FROM TECHNOPARK.GROUPS INNER JOIN TECHNOPARK.EMPLOYEES ON TECHNOPARK.GROUPS.ID_EMPLOYEES = TECHNOPARK.EMPLOYEES.ID_EMPLOYEES INNER JOIN TECHNOPARK.DIR_STATUS_GROUP ON TECHNOPARK.GROUPS.STATUS = TECHNOPARK.DIR_STATUS_GROUP.ID_DIR_STATUS_GROUP INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.GROUPS.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS WHERE ID_GROUPT!=0 and TECHNOPARK.EMPLOYEES.FIO= '" + Class_FIO.Employees_fio + "' "; SqlDataSource1.DataBind(); GridView1.DataBind(); SqlDataSource2.DataBind(); GridView2.DataBind(); } if (Class_FIO.Employees_position == "1") { string command1 = SqlDataSource1.SelectCommand; SqlDataSource1.SelectCommand = "SELECT TECHNOPARK.GROUPS.TITLE, TECHNOPARK.EMPLOYEES.FIO, TECHNOPARK.DIR_PROJECTS.TITLE AS EXPR1, TECHNOPARK.GROUPS.D_START, TECHNOPARK.GROUPS.D_END, TECHNOPARK.GROUPS.D_CONFERENCE, TECHNOPARK.GROUPS.TIME_CLASS, TECHNOPARK.GROUPS.PROJECT_THEME, TECHNOPARK.DIR_STATUS_GROUP.STATUS_G, TECHNOPARK.GROUPS.ID_GROUPT FROM TECHNOPARK.GROUPS INNER JOIN TECHNOPARK.EMPLOYEES ON TECHNOPARK.GROUPS.ID_EMPLOYEES = TECHNOPARK.EMPLOYEES.ID_EMPLOYEES INNER JOIN TECHNOPARK.DIR_STATUS_GROUP ON TECHNOPARK.GROUPS.STATUS = TECHNOPARK.DIR_STATUS_GROUP.ID_DIR_STATUS_GROUP INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.GROUPS.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS WHERE ID_GROUPT!=0"; SqlDataSource1.DataBind(); GridView1.DataBind(); SqlDataSource2.DataBind(); GridView2.DataBind(); } Label2.Visible = false; Label4.Visible = false; DropDownList1.Visible = false; Button3.Visible = false; Label11.Visible = false; Label12.Visible = false; Button2.Visible = false; Label3.Visible = false; GridView2.Visible = false; DropDownList2.Visible = false; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (((LinkButton)e.CommandSource).Text.Equals("Accept")) { GridViewRow rowSelect = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int rowindex = rowSelect.RowIndex; int userId; int courseID; userId = Convert.ToInt32(GridView1.DataKeys[rowindex].Values["senderID"].ToString()); courseID = Convert.ToInt32(GridView1.DataKeys[rowindex].Values["courseID"].ToString()); PerformanceAnalyzerDataContext dbcontext = new PerformanceAnalyzerDataContext(); // dbcontext.Database.SqlQuery<String>(@"insert into Lecture_Course values("+userId.ToString()+","+courseID.ToString()+")"); dbcontext.spGrantCourse(userId, courseID); GridView1.DataBind(); DetailsView1.Visible = false; } else if (((LinkButton)e.CommandSource).Text.Equals("Delete")) { GridViewRow rowSelect = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int rowindex = rowSelect.RowIndex; int userId; int courseID; userId = Convert.ToInt32(GridView1.DataKeys[rowindex].Values["senderID"].ToString()); courseID = Convert.ToInt32(GridView1.DataKeys[rowindex].Values["courseID"].ToString()); PerformanceAnalyzerDataContext dbcontext = new PerformanceAnalyzerDataContext(); // dbcontext.Database.SqlQuery<String>(@"delete from [message] where senderID=" + userId.ToString()); dbcontext.spDeleteMessage(userId); GridView1.DataBind(); DetailsView1.Visible = true; } else if (((LinkButton)e.CommandSource).Text.Equals("More...")) { DetailsView1.Visible = true; GridViewRow rowSelect = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); int rowindex = rowSelect.RowIndex; int userId; int courseID; userId = Convert.ToInt32(GridView1.DataKeys[rowindex].Values["senderID"].ToString()); courseID = Convert.ToInt32(GridView1.DataKeys[rowindex].Values["courseID"].ToString()); SqlDataSource2.SelectParameters["userID"].DefaultValue = userId.ToString(); SqlDataSource2.DataBind(); DetailsView1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { hfLocation.Value = "Home"; hfDate.Value = DateTime.Today.ToString(); SqlDataSource2.Delete(); HiddenField1.Value = "Not Read"; if (Request.Cookies["userid"] != null && Request.Cookies["pwd"] != null) { HttpCookie c1 = Request.Cookies["userid"]; HttpCookie c2 = Request.Cookies["pwd"]; hfUserID.Value = c1.Value; hfPwd.Value = c2.Value; DataView dv = (DataView)sqlLogin.Select(new DataSourceSelectArguments()); if (dv == null) { return; } if (dv.Count == 1) { Session.Add("Name", dv[0][0]); Session.Add("Gender", dv[0][1]); Session.Add("UserId", dv[0][2]); Session.Add("Password", dv[0][3]); if (dv[0][4] == DBNull.Value) { Session.Add("EmailId", "-"); } Session.Add("EmailId", dv[0][4]); } } if (Session["UserId"] != null) { DataView dv = (DataView)SqlDataSource1.Select(new DataSourceSelectArguments()); if (dv.Count == 1) { if (!dv[0][0].ToString().Equals("0")) { Label5.Text = dv[0][0].ToString(); Label6.Text = "Notifications: "; } } PanelLogin.Visible = false; String s = (String)Session["Name"]; String[] arr = s.Split(' '); String fname = arr[0]; lblName.Text = fname; PanelLogout.Visible = true; } }
protected void ButtonОк2_Click(object sender, EventArgs e) { //Удаляем Вопрос SqlDataSource2.DeleteCommand = @"DELETE FROM Tests WHERE (Номер = '" + GridView2.SelectedDataKey.Values[0].ToString() + "') AND (TestSeriesId = '" + GridView2.SelectedDataKey.Values[1].ToString() + "')"; SqlDataSource2.Delete(); GridView2.SelectRow(-1); Panel2.Visible = false; GridView2.Enabled = true; }
public bool AdminPermissions(int DepartmentID) { // Checks if the user has Is_Admin permission for this department DataView dv = (DataView)SqlDataSource2.Select(DataSourceSelectArguments.Empty); dv.RowFilter = "UserID = '" + Session["UserID"] + "' AND DepartmentID = " + DepartmentID; DataRowView dr = dv[0]; if (dr["Is_Admin"].ToString() == "True") { return(true); } return(false); }
protected void BtnAddNote_Click(object sender, EventArgs e) { if (Page.IsValid) { SqlDataSource2.InsertParameters["CategoryID"].DefaultValue = DdlCategory.Text; SqlDataSource2.InsertParameters["NoteTitle"].DefaultValue = TxtTitle.Text; SqlDataSource2.InsertParameters["CourseCode"].DefaultValue = TxtCourse.Text; SqlDataSource2.InsertParameters["Author"].DefaultValue = TxtAuthor.Text; SqlDataSource2.InsertParameters["NumberOfPages"].DefaultValue = TxtPages.Text; SqlDataSource2.InsertParameters["NoteUrl"].DefaultValue = TxtNoteUrl.Text; SqlDataSource2.Insert(); Server.Transfer("Browse.aspx", true); } }
protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { try { if (Session["1C00STATION"].ToString() != "") { string sql = Session["1C00STATION"] as string; SqlDataSource2.SelectCommand = sql; SqlDataSource2.DataBind(); } } catch { } }
private void LearnerLabInteres() { string command = SqlDataSource2.SelectCommand; //SqlDataSource2.SelectCommand = "SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, TECHNOPARK.QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM (SELECT ID_LEARNER_Q AS ID_l, ID_QUEUE FROM QUEUE WHERE ID_STATUS_L = 2 OR ID_STATUS_L = 10) A, TECHNOPARK.LEARNER INNER JOIN TECHNOPARK.QUEUE ON TECHNOPARK.LEARNER.ID_LEARNER = TECHNOPARK.QUEUE.ID_LEARNER_Q INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_STATUS_LEARNER ON TECHNOPARK.QUEUE.ID_STATUS_L = TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER WHERE(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 2) AND(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 6) AND(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 7) AND(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 8) AND(TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 10) and TECHNOPARK.DIR_LABORATORIES.LABORATORY = '" + DropDownList2.Text + "' and ID_LEARNER!= 0 AND QUEUE.ID_QUEUE != 0 AND A.ID_QUEUE = QUEUE.ID_QUEUE AND LEARNER.ID_LEARNER<> A.ID_l"; //SqlDataSource2.SelectCommand = "SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, TECHNOPARK.QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM TECHNOPARK.QUEUE INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.LEARNER ON TECHNOPARK.QUEUE.ID_LEARNER_Q = TECHNOPARK.LEARNER.ID_LEARNER where TECHNOPARK.LEARNER.INTERESTS LIKE '%" + DropDownList2.Text + "%' minus SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM TECHNOPARK.QUEUE INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.LEARNER ON TECHNOPARK.QUEUE.ID_LEARNER_Q = TECHNOPARK.LEARNER.ID_LEARNER INNER JOIN (SELECT DISTINCT ID_LEARNER_Q AS id_q FROM TECHNOPARK.QUEUE b WHERE (ID_STATUS_L = 2) OR (ID_STATUS_L = 10)) a ON TECHNOPARK.QUEUE.ID_LEARNER_Q = a.id_q"; SqlDataSource2.SelectCommand = "SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, TECHNOPARK.QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.LEARNER.PHONE, TECHNOPARK.LEARNER.INTERESTS, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM TECHNOPARK.QUEUE INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.LEARNER ON TECHNOPARK.QUEUE.ID_LEARNER_Q = TECHNOPARK.LEARNER.ID_LEARNER where TECHNOPARK.QUEUE.Date_Registration = (Select max(Date_Registration) from QUEUE Q where Q.ID_LEARNER_Q = TECHNOPARK.QUEUE.ID_LEARNER_Q) and TECHNOPARK.LEARNER.INTERESTS LIKE '%" + DropDownList2.Text + "%' or(TECHNOPARK.DIR_LABORATORIES.LABORATORY = '" + DropDownList2.Text + "' and((ID_STATUS_L = 1) OR(ID_STATUS_L = 4))) minus SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.LEARNER.PHONE, TECHNOPARK.LEARNER.INTERESTS, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM TECHNOPARK.QUEUE INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.LEARNER ON TECHNOPARK.QUEUE.ID_LEARNER_Q = TECHNOPARK.LEARNER.ID_LEARNER INNER JOIN (SELECT DISTINCT ID_LEARNER_Q AS id_q FROM TECHNOPARK.QUEUE b WHERE(ID_STATUS_L = 2) OR(ID_STATUS_L = 10)) a ON TECHNOPARK.QUEUE.ID_LEARNER_Q = a.id_q"; //SqlDataSource2.SelectCommand = "SELECT TECHNOPARK.LEARNER.ID_LEARNER, TECHNOPARK.LEARNER.FIO, TECHNOPARK.QUEUE.DATE_REGISTRATION, TECHNOPARK.LEARNER.CLASS, TECHNOPARK.LEARNER.SHIFT, TECHNOPARK.LEARNER.SCHOOL, TECHNOPARK.DIR_LABORATORIES.LABORATORY, TECHNOPARK.DIR_PROJECTS.TITLE, TECHNOPARK.QUEUE.ID_QUEUE FROM TECHNOPARK.LEARNER INNER JOIN TECHNOPARK.QUEUE ON TECHNOPARK.LEARNER.ID_LEARNER = TECHNOPARK.QUEUE.ID_LEARNER_Q INNER JOIN TECHNOPARK.DIR_PROJECTS ON TECHNOPARK.QUEUE.ID_PROJECT = TECHNOPARK.DIR_PROJECTS.ID_DIR_PROJECTS INNER JOIN TECHNOPARK.DIR_LABORATORIES ON TECHNOPARK.QUEUE.ID_LABORATORIES = TECHNOPARK.DIR_LABORATORIES.ID_LABORATORIES INNER JOIN TECHNOPARK.DIR_STATUS_LEARNER ON TECHNOPARK.QUEUE.ID_STATUS_L = TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER WHERE (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 2) AND (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 6) AND (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 7) AND (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 8) AND (TECHNOPARK.DIR_STATUS_LEARNER.ID_DIR_STATUS_LEARNER <> 10) and ID_LEARNER !=0 and TECHNOPARK.LEARNER.INTERESTS LIKE '%" + DropDownList2.Text + "%' or TECHNOPARK.DIR_LABORATORIES.LABORATORY = '" + DropDownList2.Text + "' AND ID_QUEUE!=0 "; SqlDataSource2.DataBind(); CheckBox1.DataBind(); GridView1.DataBind(); Label9.Visible = true; Label9.Text = "Список обучающихся по выбранному проекту, с учетом интересов"; }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { Panel2.Visible = true; Panel3.Visible = true; Label3.Text = GridView1.SelectedValue.ToString(); string s; s = "select * from request where reqno='" + Label3.Text + "'"; SqlDataSource2.SelectCommand = s; SqlDataSource2.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { hfDisable.Value = "Yes"; hfConfirm.Value = "Yes"; hfStatus.Value = "Yes"; int n = SqlDataSource1.Update(); if (n == 1) { SqlDataSource2.Update(); Response.Write("<script>alert('User Confirmed Successfully..')</script>"); } Server.Transfer("FlatDetails.aspx"); }
protected void comboStationCode_Init(object sender, EventArgs e) { try { if (Session["1C00STATION"].ToString() != "") { string sql = Session["1C00STATION"] as string; SqlDataSource2.SelectCommand = sql; SqlDataSource2.DataBind(); } } catch { } }
protected void btnAdd_Click(object sender, EventArgs e) { if (IsValid) { //insert row var parameters = SqlDataSource2.InsertParameters; parameters["County"].DefaultValue = txtInsertCounty.Text; parameters["Price"].DefaultValue = txtInsertPrice.Text; parameters["Bed"].DefaultValue = txtInsertBed.Text; parameters["Bath"].DefaultValue = txtInsertBath.Text; parameters["SquareFeet"].DefaultValue = txtInsertSqft.Text; parameters["Address"].DefaultValue = txtInsertAddress.Text; parameters["City"].DefaultValue = txtInsertCity.Text; parameters["State"].DefaultValue = txtInsertState.Text; parameters["Zip"].DefaultValue = txtInsertZip.Text; parameters["NextOpenHouse"].DefaultValue = txtInsertOpenHouse.Text; if (filePics.HasFiles) { int i = 1; foreach (HttpPostedFile uploadedFile in filePics.PostedFiles) { string name = "Pic" + i; i++; try { parameters[name].DefaultValue = uploadedFile.FileName; } catch (Exception ex) { lblError.Text = "Each row can only contain 9 images."; } } } try { SqlDataSource2.Insert(); } catch (Exception ex) { lblError.Text = "A database error has occurred. Message: " + ex.Message; } if (filePics.HasFiles) { foreach (HttpPostedFile uploadFile in filePics.PostedFiles) { uploadFile.SaveAs(System.IO.Path.Combine(Server.MapPath("~/Images/"), uploadFile.FileName)); } } } }