Ejemplo n.º 1
0
        private void b_amend_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (dg_krrx.CurrentRow != null)
            {
                int i = dg_krrx.CurrentRow.Index;

                //修改成表对应的行号
                DataRowView dgr = dg_krrx.Rows[i].DataBoundItem as DataRowView;
                i = DS_Xkrrx.Tables[0].Rows.IndexOf(dgr.Row);

                if (DS_Xkrrx.Tables[0].Rows[i]["id"].ToString() != "")
                {
                    Xxtsz.Xkrrx_add_edit Xkrrx_add_edit_new = new Xkrrx_add_edit(this);
                    Xkrrx_add_edit_new.Left           = common_file.common_app.x() - 200;
                    Xkrrx_add_edit_new.Top            = common_file.common_app.y() - 100;
                    Xkrrx_add_edit_new.judge_add_edit = common_file.common_app.get_edit;
                    Xkrrx_add_edit_new.Xkrrx_id       = DS_Xkrrx.Tables[0].Rows[i]["id"].ToString();
                    Xkrrx_add_edit_new.tB_krrx.Text   = DS_Xkrrx.Tables[0].Rows[i]["krrx"].ToString();
                    Xkrrx_add_edit_new.tB_zjm.Text    = DS_Xkrrx.Tables[0].Rows[i]["zjm"].ToString();
                    Xkrrx_add_edit_new.ShowDialog();
                }
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 2
0
 private void b_new_Click(object sender, EventArgs e)
 {
     common_file.common_app.get_czsj();
     Xxtsz.Xkrrx_add_edit Xkrrx_add_edit_new = new Xkrrx_add_edit(this);
     Xkrrx_add_edit_new.Left = common_file.common_app.x() - 200;
     Xkrrx_add_edit_new.Top  = common_file.common_app.y() - 100;
     Xkrrx_add_edit_new.ShowDialog();
     Cursor.Current = Cursors.Default;
 }
Ejemplo n.º 3
0
 private void b_delete_Click(object sender, EventArgs e)
 {
     if (dg_krrx.CurrentRow != null)
     {
         int         i   = dg_krrx.CurrentRow.Index;
         DataRowView dgr = dg_krrx.CurrentRow.DataBoundItem as DataRowView;
         i = DS_Xkrrx.Tables[0].Rows.IndexOf(dgr.Row);
         if (DS_Xkrrx.Tables[0].Rows[i]["id"].ToString() != "")
         {
             Xxtsz.Xkrrx_add_edit Xkrrx_add_edit_new = new Xkrrx_add_edit(this);
             Xkrrx_add_edit_new.Xkrrx_id = DS_Xkrrx.Tables[0].Rows[i]["id"].ToString();
             B_Xkrrx.Delete(int.Parse(Xkrrx_add_edit_new.Xkrrx_id));
         }
         refresh_app();
     }
 }