private double GetNewVersionNumber(tblUser user) { try { List<double> versions = new List<double>(); foreach (var q in dc.tblLogs.Select(z => z.LOG_VERSION)) { double ver = 0; double.TryParse(q, out ver); versions.Add(ver); } return versions.Max(); } catch { return 0; } }
partial void DeletetblUser(tblUser instance);
partial void UpdatetblUser(tblUser instance);
partial void InserttblUser(tblUser instance);
private void ChangeUserNameForm_Load(object sender, EventArgs e) { User = dc.tblUsers.Where(z => z.ID == _admin.UserID).First(); usernameInputTextbox.Text = User.USER_NAME; }
private void CreateNewUserIfNotExist() { if (!dc.tblUsers.Any(z => z.USER_MACADRESS == mac)) { var user = new tblUser { USER_NAME = Utilities.GetUsername(), USER_MACADRESS = mac, USER_ADMIN = false, }; dc.tblUsers.InsertOnSubmit(user); dc.SubmitChanges(); } }
private void userListView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) { if (userListView.SelectedItems.Count == 0) return; Cursor = Cursors.WaitCursor; SelectedUser = (tblUser)userListView.SelectedItems[0].Tag; foreach (ListViewItem lvi in userListView.Items) lvi.Checked = false; Cursor = Cursors.Default; }
private void DisplayUserInfo(tblUser user) { nameSelectedLabel.Text = "Send :"; }