private void gridiListo_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == gridiListo.Columns["Edito"].Index && e.RowIndex >= 0) { frmRegjistroklienta frmRegjistroklienta = new frmRegjistroklienta(); if (this.gridiListo[5, gridiListo.CurrentCell.RowIndex].Value.ToString() != null) { var d = new Users(); int userID = Convert.ToInt32(this.gridiListo[0, gridiListo.CurrentCell.RowIndex].Value); string emri = this.gridiListo[1, gridiListo.CurrentCell.RowIndex].Value.ToString(); string mbiemri = this.gridiListo[2, gridiListo.CurrentCell.RowIndex].Value.ToString(); string username = this.gridiListo[3, gridiListo.CurrentCell.RowIndex].Value.ToString(); string email = this.gridiListo[4, gridiListo.CurrentCell.RowIndex].Value.ToString(); frmRegjistroklienta.editoklientat(userID, emri, mbiemri, username, email); } } else if (e.ColumnIndex == gridiListo.Columns["Fshij"].Index && e.RowIndex >= 0) { if (this.gridiListo[1, gridiListo.CurrentCell.RowIndex].Value.ToString() != null) { var d = new Users(); d.ID = Convert.ToInt32(this.gridiListo[0, gridiListo.CurrentCell.RowIndex].Value); int qo = d.ID; listoKlient.fshij(qo); LoadData(rolet); } } }
private void button3_Click(object sender, EventArgs e) { frmRegjistroklienta frmRegjistroklienta = new frmRegjistroklienta(); if (this.gridiListo[0, gridiListo.CurrentCell.RowIndex].Value.ToString() != null) { var d = new Users(); int userID = Convert.ToInt32(this.gridiListo[0, gridiListo.CurrentCell.RowIndex].Value); string emri = this.gridiListo[1, gridiListo.CurrentCell.RowIndex].Value.ToString(); string mbiemri = this.gridiListo[2, gridiListo.CurrentCell.RowIndex].Value.ToString(); string username = this.gridiListo[3, gridiListo.CurrentCell.RowIndex].Value.ToString(); string email = this.gridiListo[4, gridiListo.CurrentCell.RowIndex].Value.ToString(); frmRegjistroklienta.editoklientat(userID, emri, mbiemri, username, email); } }