private void UpdateClick(object sender, EventArgs e)
        {
            var form = new FrmAddReplaceUser(new AddReplaceUser(new Role()), user, new User(new CatalogBase()));

            form.Show(this.Owner);
            this.Close();
        }
Example #2
0
 private void CellClicked(object sender, DataGridViewCellEventArgs e)
 {
     if ((e.ColumnIndex == 0 || e.ColumnIndex == 1) && e.RowIndex >= 0)
     {
         var user = new UserModel()
         {
             Id       = int.Parse(this.dtBussiness.Rows[e.RowIndex].Cells["Id"].Value.ToString()),
             Email    = this.dtBussiness.Rows[e.RowIndex].Cells["Email"].Value.ToString(),
             Name     = this.dtBussiness.Rows[e.RowIndex].Cells["Name"].Value.ToString(),
             Password = this.dtBussiness.Rows[e.RowIndex].Cells["Password"].Value.ToString(),
             Role     = new RoleModel()
             {
                 Id   = int.Parse(((RoleModel)this.dtBussiness.Rows[e.RowIndex].Cells["Role"].Value).Id.ToString()),
                 Name = this.dtBussiness.Rows[e.RowIndex].Cells["RoleText"].Value.ToString()
             },
             RoleText     = this.dtBussiness.Rows[e.RowIndex].Cells["RoleText"].Value.ToString(),
             State        = int.Parse(this.dtBussiness.Rows[e.RowIndex].Cells["State"].Value.ToString()),
             StateText    = this.dtBussiness.Rows[e.RowIndex].Cells["StateText"].Value.ToString(),
             CreationDate = this.dtBussiness.Rows[e.RowIndex].Cells["CreationDate"].Value.ToString()
         };
         if (e.ColumnIndex == 0)
         {
             var form = new FrmAddReplaceUser(new AddReplaceUser(new Role()), user, new User(_catalog));
             form.Show(this);
         }
         else
         {
             var form = new FrmDetailUser(new DetailUser(), user);
             form.Show(this);
         }
     }
 }