private void back_Click(object sender, EventArgs e) { this.Hide(); Resourcemanagement resourcemanagement = new Resourcemanagement(); resourcemanagement.Show(); }
private void update_Click(object sender, EventArgs e) { var get1 = db.Resources.Where(x => x.resId == IDs).FirstOrDefault(); if (get1 != null) { get1.remainingQuantity = (int)numericUpDown1.Value; } if (numericUpDown1.Value != 0) { var q4 = db.Resource_Allocation.Where(x => x.resIdFK == IDs).ToList(); foreach (var item in q4) { db.Resource_Allocation.Remove(item); } foreach (var item in checkedListBox1.CheckedItems) { Resource_Allocation resource_Allocation = new Resource_Allocation(); resource_Allocation.resIdFK = IDs; var q3 = db.Skills.Where(x => x.skillName == item.ToString()).FirstOrDefault(); if (q3 != null) { resource_Allocation.skillIdFK = q3.skillId; } db.Resource_Allocation.Add(resource_Allocation); } try { db.SaveChanges(); MessageBox.Show("Sucess!"); this.Hide(); Resourcemanagement lol1 = new Resourcemanagement(); lol1.Show(); } catch (Exception es) { MessageBox.Show(es.ToString()); } } else { MessageBox.Show("Sucess!"); this.Hide(); Resourcemanagement lol1 = new Resourcemanagement(); lol1.Show(); } }
private void login_Click(object sender, EventArgs e) { var q1 = db.Users.Where(x => x.userId == UID.Text && x.userPw == Pass.Text).FirstOrDefault(); if (q1 != null) { this.Hide(); Resourcemanagement resourcemanagement = new Resourcemanagement(); resourcemanagement.Show(); } else { MessageBox.Show("Invalid Username Or Password!"); return; } }