コード例 #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session["aa"]     = GridView1.Rows[GridView1.Rows.Count - 1].Cells[3].Text;
        Session["bb"]     = GridView1.Rows[GridView1.Rows.Count - 1].Cells[5].Text;
        Session["cc"]     = GridView1.Rows[GridView1.Rows.Count - 1].Cells[7].Text;
        Session["dd"]     = GridView1.Rows[GridView1.Rows.Count - 1].Cells[9].Text;
        Session["kimlik"] = GridView1.Rows[GridView1.Rows.Count - 1].Cells[0].Text;

        if (RadioButtonList1.Items[0].Selected == true)
        {
            Session["aa"] = Convert.ToInt32(Session["aa"]) + 1;
        }

        if (RadioButtonList1.Items[1].Selected == true)
        {
            Session["bb"] = Convert.ToInt32(Session["bb"]) + 1;
        }

        if (RadioButtonList1.Items[2].Selected == true)
        {
            Session["cc"] = Convert.ToInt32(Session["cc"]) + 1;
        }
        if (RadioButtonList1.Items[3].Selected == true)
        {
            Session["dd"] = Convert.ToInt32(Session["dd"]) + 1;
        }

        AccessDataSource1.Update();
    }
コード例 #2
0
ファイル: MakePayment.aspx.cs プロジェクト: yunisara/DDAC
 protected void Button1_Click(object sender, EventArgs e)
 {
     Session["Now"] = DateTime.Now.ToString();
     AccessDataSource3.Insert();
     AccessDataSource1.Update();
     Response.Redirect("~/Member/ViewHistory.aspx");
 }
コード例 #3
0
 private void modificaInregistrare()
 {
     AccessDataSource1.UpdateParameters[0].DefaultValue = TxtDProdus.Text;
     AccessDataSource1.UpdateParameters[1].DefaultValue = DdlUM.Text;
     AccessDataSource1.UpdateParameters[2].DefaultValue = DdlTVA.Text;
     AccessDataSource1.UpdateParameters[3].DefaultValue = TxtPretVanzare.Text;
     AccessDataSource1.UpdateParameters[4].DefaultValue = TxtIdProdus.Text;
     AccessDataSource1.Update();
 }
コード例 #4
0
    protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e)
    {
        AccessDataSource1.UpdateParameters["EmployeeID"].DefaultValue = ASPxTextBoxEmployeeID.Value.ToString();
        AccessDataSource1.UpdateParameters["LastName"].DefaultValue   = ASPxTextBoxLastName.Value.ToString();
        AccessDataSource1.UpdateParameters["FirstName"].DefaultValue  = ASPxTextBoxFirstName.Value.ToString();
        AccessDataSource1.UpdateParameters["BirthDate"].DefaultValue  = Convert.ToDateTime(ASPxDateEditBirthDate.Value).ToShortDateString();

        //for example purpose only, because online editing is not supported
        throw new Exception("Editing in online example is not supported"); //remove this line when testing the project

        AccessDataSource1.Update();                                        //Uncomment this line

        ASPxGridView gridView = (ASPxGridView)sender;

        gridView.DataBind();
    }
 protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
 {
     string[] param = e.Parameters.Split('|');
     if (param[0] == "oneRow")
     {
         int          visibleIndex   = int.Parse(param[1]);
         ASPxGridView grid           = sender as ASPxGridView;
         ASPxTextBox  tbCategoryName = grid.FindRowCellTemplateControl(visibleIndex, grid.Columns["CategoryName"] as GridViewDataColumn, "txtBox") as ASPxTextBox;
         ASPxTextBox  tbDescription  = grid.FindRowCellTemplateControl(visibleIndex, grid.Columns["Description"] as GridViewDataColumn, "txtBox") as ASPxTextBox;
         AccessDataSource1.UpdateParameters["CategoryName"].DefaultValue = tbCategoryName.Text;
         AccessDataSource1.UpdateParameters["Description"].DefaultValue  = tbDescription.Text;;
         AccessDataSource1.UpdateParameters["CategoryID"].DefaultValue   = grid.GetRowValues(visibleIndex, "CategoryID").ToString();
         AccessDataSource1.Update();
     }
     ASPxGridView1.DataBind();
 }
    protected void Grid_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
    {
        throw new CallbackException();
        object values = RowValuesHf.Get("Values");

        string[] rowValues = Array.ConvertAll((object[])values, s => (string)s);
        AccessDataSource1.UpdateParameters["CustomerID"].DefaultValue   = rowValues[0];
        AccessDataSource1.UpdateParameters["CompanyName"].DefaultValue  = rowValues[1];
        AccessDataSource1.UpdateParameters["ContactName"].DefaultValue  = rowValues[2];
        AccessDataSource1.UpdateParameters["ContactTitle"].DefaultValue = rowValues[3];
        AccessDataSource1.UpdateParameters["Address"].DefaultValue      = rowValues[4];
        AccessDataSource1.UpdateParameters["City"].DefaultValue         = rowValues[5];
        AccessDataSource1.UpdateParameters["PostalCode"].DefaultValue   = rowValues[6];
        AccessDataSource1.UpdateParameters["Country"].DefaultValue      = rowValues[7];
        AccessDataSource1.UpdateParameters["Phone"].DefaultValue        = rowValues[8];
        AccessDataSource1.UpdateParameters["Fax"].DefaultValue          = rowValues[9];
        AccessDataSource1.Update();
        Grid.DataBind();
    }
コード例 #7
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox txtname       = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox1");
        TextBox txtdept       = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox2");
        TextBox txtyr         = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox3");
        TextBox txttenth      = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox4");
        TextBox txttwelth     = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox5");
        TextBox txtcgpa       = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox6");
        TextBox txtarrhistory = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox7");
        TextBox txtstanarr    = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox8");
        TextBox txtarrcount   = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox9");
        TextBox txtemail      = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox10");
        TextBox txtphone      = (TextBox)GridView1.Rows[e.RowIndex].FindControl("TextBox11");
        int     sid           = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0].ToString());

        data();
        query = "update studet set Studentname='" + txtname.Text + "',Dept='" + txtdept.Text + "',SYear='" + txtyr.Text + "',tenth='" + txttenth.Text + "',twelth='" + txttwelth.Text + "',CGPA='" + txtcgpa.Text + "',Arrhistory='" + txtarrhistory.Text + "',Standarr='" + txtstanarr.Text + "',Arrcount='" + txtarrcount.Text + "',Email='" + txtemail.Text + "',Phoneno='" + txtphone.Text + "' where id=" + sid + "";
        AccessDataSource1.UpdateCommand = query;
        AccessDataSource1.Update();
        con.Close();
        GridView1.DataBind();
    }
コード例 #8
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     AccessDataSource1.Update();
 }