Пример #1
0
        //add
        private void btn_add_Click(object sender, EventArgs e)
        {
            FRM_USERS_ADD frm_add = new FRM_USERS_ADD();

            frm_add.id           = 0;
            frm_add.btn_add.Text = "اضافة";
            frm_add.Show();
        }
Пример #2
0
        //edit
        private void btn_edit_Click(object sender, EventArgs e)
        {
            FRM_USERS_ADD frm_add = new FRM_USERS_ADD();

            id      = Convert.ToInt32(gridView1.GetFocusedRowCellValue("ID"));
            tb_user = db.TB_Users.Where(x => x.ID == id).FirstOrDefault();

            frm_add.txt_username.Text = tb_user.User_Name;
            frm_add.txt_pass.Text     = tb_user.User_Password;
            frm_add.txt_rol.Text      = tb_user.User_Rol;

            frm_add.id           = id;
            frm_add.btn_add.Text = "تعديل";
            frm_add.Show();
        }