private void EditUser() { if (DGVUsers.SelectedRows.Count <= 0) { return; } long SyncId = Convert.ToInt64(DGVUsers.SelectedRows[0].Cells["id"].Value); user = new cls_user(); user.setcls_user_by_wid(SyncId, true); EnableUserModifierPanel(); tbx_Usercode.Text = user.getusercode().Trim(); tbx_Fullname.Text = user.getfullname().Trim(); tbx_Username.Text = user.username.Trim(); tbx_Password.Text = user.password.Trim(); cmbx_position.Text = user.position.Trim(); foreach (KeyValuePair <string, CheckBox> dicentry in AuthDictionary) { dicentry.Value.Checked = (user.AuthorizationList.Contains(dicentry.Key)) ? true : false; } }
private void btnDeactivate_Click(object sender, EventArgs e) { string SQL = @"UPDATE `user` SET `status`=" + ((user.status == 0) ? "1" : "0") + @",`lastmodifiedby` = " + user.syncid + @" WHERE `SyncId`=" + user.getsyncid(); //lastmodifiedby //lastdeactivatedby //make sure no duplicate fields mySQLFunc.setdb(SQL); EnableViewUsersPanel(); fncFilter.alert("user " + user.getfullname() + ((user.status == 0) ? " Reactivated" : " Deactivated")); }