protected void g1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        proj proj1 = new proj();

        proj1.Proj_id    = (g1.Rows[e.RowIndex].Cells[0].Controls[0] as TextBox).Text;
        proj1.Proj_name  = (g1.Rows[e.RowIndex].Cells[1].Controls[0] as TextBox).Text;
        proj1.Proj_type  = (g1.Rows[e.RowIndex].Cells[2].Controls[0] as TextBox).Text;
        proj1.Proj_grade = (g1.Rows[e.RowIndex].Cells[3].Controls[0] as TextBox).Text;
        proj1.Tea_id     = (g1.Rows[e.RowIndex].Cells[4].Controls[0] as TextBox).Text;
        int zhiyuan = int.Parse(((TextBox)g1.Rows[e.RowIndex].Cells[5].Controls[0]).Text);

        string sql = "update proj_info set proj_name='" + proj1.Proj_name + "',proj_type='" + proj1.Proj_type + "',proj_grade='" +
                     proj1.Proj_grade + "',tea_id='" + proj1.Tea_id + "',proj_zhuang='" + zhiyuan + "' where proj_id='" + proj1.Proj_id + "'";
        Boolean flag = CC.ExecSQL(sql);

        if (flag == true)
        {
            string str = "<script language=javascript>alert('添加成功')</script>";
            Response.Write(str);
            bind();
        }
        else
        {
            string str = "<script language=javascript>alert('添加成功')</script>";
            Response.Write(str);
        }
        g1.EditIndex = -1;//取消编辑
        bind();
    }
Пример #2
0
 public MainWin()
 {
     MaterialsVis = Visibility.Collapsed;
     IntegrSchems = new List <integr.Schems>()
     {
         integr.Schems.euler, integr.Schems.gear, integr.Schems.verlet
     };
     mModels = new List <models>()
     {
         models.linear, models.nonlinear, models.particles
     };
     forceAx  = new forceAx();
     acclAx   = new acclAx();
     velosAx  = new velosAx();
     displAx  = new displAx();
     coordAx  = new coordAx();
     currProj = new proj();
 }