/// <summary> /// Devuelve la jerarquÃa de permisos para el elemento seleccionado /// </summary> /// <param name="sender"></param> /// <returns></returns> private ProfileBM GetPermissionHierarchy(ProfileBM selection) { ProfileBLL profileBll = new ProfileBLL(); ResultBM result = profileBll.GetProfile(selection.code); if (!result.IsValid()) { MessageBox.Show(result.description, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return(result.GetValue() as ProfileBM); }
public IActionResult UpdateProfile(int IDNumber) { ProfileBLL profileBLL = new ProfileBLL(); Profile profile = profileBLL.GetProfile(IDNumber); if (profile == null) { NotFound(); } return(View(profile)); }
public IActionResult ProfileDetails() { ProfileBLL profileBLL = new ProfileBLL(); //string userName = this.User.Claims.FirstOrDefault(c => c.Type == "Name").Value; string userName = HttpContext.User.FindFirst(ClaimTypes.Name).Value; BillingSystemContext context = new BillingSystemContext(); Users currUser = context.Users.FirstOrDefault(u => u.UserName == userName); Profile prof = profileBLL.GetProfile(currUser.ProfileID); if (prof == null) { NotFound(); } return(View(prof)); }
private void signin_Click(object sender, EventArgs e) { user = Username.Text; pass = Password.Text; if (user == "" && pass == "") { //MessageBox.Show("Empty Fields Detected ! Please fill up all the fields"); this.Close(); th = new Thread(mainpage); th.SetApartmentState(ApartmentState.STA); th.Start(); } else if (user == "garment" && pass == "") { this.Close(); th = new Thread(garment_mainpage); th.SetApartmentState(ApartmentState.STA); th.Start(); } else if (user == "haar" && pass == "") { this.Close(); th = new Thread(facedet_reg); th.SetApartmentState(ApartmentState.STA); th.Start(); } else if (user == "haar2" && pass == "") { this.Close(); th = new Thread(haar22); th.SetApartmentState(ApartmentState.STA); th.Start(); } else if (user == "open" && pass == "") { this.Close(); th = new Thread(open); th.SetApartmentState(ApartmentState.STA); th.Start(); } else { ProfileBLL objbll = new ProfileBLL(); int count = (int)objbll.GetProfile(user, pass); if (count == -1) { MessageBox.Show("Error "); } Console.WriteLine(count); if (count > 0) { this.Close(); th = new Thread(mainpage); th.SetApartmentState(ApartmentState.STA); th.Start(); Console.WriteLine("Correct Login Cresentials"); } } }
private void signin_Click(object sender, EventArgs e) { user = Username.Text; pass = Password.Text; if (user == "Username" && pass == "Password") { MetroFramework.MetroMessageBox.Show(this, "Please Enter Login Credentials", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.Close(); th = new Thread(foodForm); th.SetApartmentState(ApartmentState.STA); th.Start(); } //MetroFramework.MetroMessageBox.Show(this, "Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); else if (user == "" && pass == "") {//MetroFramework.MetroMessageBox.Show(this, "Empty Fields Detected ! Please fill up all the fields", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); //MessageBox.Show("Empty Fields Detected ! Please fill up all the fields"); this.Close(); th = new Thread(mainpage); th.SetApartmentState(ApartmentState.STA); th.Start(); } else if (user == "garment" && pass == "") { this.Close(); th = new Thread(garment_mainpage); th.SetApartmentState(ApartmentState.STA); th.Start(); } else if (user == "haar" && pass == "") { this.Close(); th = new Thread(facedet_reg); th.SetApartmentState(ApartmentState.STA); th.Start(); } else if (user == "haar2" && pass == "") { this.Close(); th = new Thread(haar22); th.SetApartmentState(ApartmentState.STA); th.Start(); } else if (user == "open" && pass == "") { this.Close(); th = new Thread(open); th.SetApartmentState(ApartmentState.STA); th.Start(); } else { ProfileBLL objbll = new ProfileBLL(); int count = (int)objbll.GetProfile(user, pass); Console.WriteLine("COUNT IS---------->" + count.ToString()); if (count == 0) { MetroFramework.MetroMessageBox.Show(this, "Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); //MessageBox.Show("Error "); } Console.WriteLine(count); if (count > 0) { this.Close(); th = new Thread(mainpage); th.SetApartmentState(ApartmentState.STA); th.Start(); Console.WriteLine("Correct Login Cresentials"); } } }
private void button1_Click(object sender, EventArgs e) { ProfileBLL objBll = new ProfileBLL(); dataGridView1.DataSource = objBll.GetProfile(); }