private void ComfirmClick(object sender, EventArgs e) { if (textBoxNewPassword.Text == textBoxRepass.Text) { string errors = ""; errors += textBoxNewPassword.Text.Length == 0 ? "\nPlease Provide New Password" : ""; errors += textBoxRepass.Text.Length == 0 ? "\nPlease provide Retype Password" : ""; errors += textBoxOldPassword.Text.Length == 0 ? "\nPlease Provide Old Password" : ""; if (errors.Length == 0) { int result = ResisterController.UpdatePassword(u.Username, textBoxOldPassword.Text, textBoxNewPassword.Text); if (result != 0) { MessageBox.Show("Password Changed Succesfully", "Message"); this.Hide(); RegisteredMember a = new RegisteredMember(u); a.Show(); } else { MessageBox.Show("Your password is incorrect", "Alert"); } } else { MessageBox.Show(errors, "Filled the flowing!"); return; } } else { MessageBox.Show("New password and re-Enter pasword doesn't match", "Alert"); } }
private void UpdateButtonClick(object sender, EventArgs e) { if (textBoxAddress.Text == null && textBoxEmail.Text == null && textBoxMobileNumber.Text == null) { MessageBox.Show("All text field are empty", "Alert"); } else { if (textBoxMobileNumber.Text.Length != 11 && textBoxMobileNumber.Text != null) { MessageBox.Show("Invalid Phone Number", "Alert"); } else { string mobile = (textBoxMobileNumber.Text == null) ? mem.Mobile_Number : textBoxMobileNumber.Text; string gmail = (textBoxEmail.Text == null) ? mem.Gmail : textBoxEmail.Text; string address = (textBoxAddress.Text == null) ? mem.Address : textBoxAddress.Text; var res = ResisterController.ResisterUpdateMember(mobile, gmail, address, mem.Username); if (res != null) { this.mem = res; MessageBox.Show("Information Updated Successfully", "Message"); this.Hide(); RegisteredMember a = new RegisteredMember(mem); a.Show(); } } } }
public RegisteredMember(dynamic user) { InitializeComponent(); this.u = user; labelName.Text = u.Username; labelBloodGroup.Text = ResisterController.GetInfo(u.Info_Id); }
private void ConfirmButtonClick(object sender, EventArgs e) { if (textBoxPassword.Text == textBoxRepass.Text) { string errors = ""; errors += textBoxPassword.Text.Length == 0 ? "\nPlease Provide Password" : ""; errors += textBoxRepass.Text.Length == 0 ? "\nPlease provide Retype password" : ""; errors += textBoxUsername.Text.Length == 0 ? "\nPlease Provide User Name" : ""; errors += (textBoxMobileNumber.Text.Length == 0 || textBoxMobileNumber.Text.Length != 11) ? "\nPlease Provide a Valid Mobile Number" : ""; if (errors.Length == 0) { var result = ResisterController.Verify(textBoxUsername.Text); if (result == textBoxMobileNumber.Text) { ResisterController.UpdatePassword(textBoxUsername.Text, textBoxPassword.Text); MessageBox.Show("Password recover successfully", "Message"); } else { MessageBox.Show("Your mobile number is incorrect", "Alert"); } } else { MessageBox.Show(errors, "Filled the flowing!"); return; } } else { MessageBox.Show("Password and Re-Enter pasword doesn't match", "Alert"); } }
private void SearchButtonClicked(object sender, EventArgs e) { string error = ""; error += comboBoxBloodGroup.SelectedItem == null ? "\nPlease Provide Blood Group" : ""; if (error == "") { string bldgrp = comboBoxBloodGroup.SelectedItem.ToString(); var member = ResisterController.GetMember(bldgrp); if (member.Count == 0) { label3.Text = "No donor is available"; } else { label3.Text = ""; } dataGridViewMember.DataSource = member; } else { MessageBox.Show("Select Blood Group", "Alert"); } }
private void SearchButtonClick(object sender, EventArgs e) { string bldgrp = comboBoxBloodGroup.SelectedItem.ToString(); Console.WriteLine(bldgrp); var member = ResisterController.GetMember(bldgrp); dataGridViewMember.DataSource = member; }
private void buttonSubmit_Click(object sender, EventArgs e) { BloodDonerController.InsertDonateInfo(u); BloodStckController.UpdateStock(ResisterController.GetInfo(u.Info_Id)); MessageBox.Show("Thank you for your donation", "Message"); //buttonBack.PerformClick(); this.Hide(); RegisteredMember f1 = new RegisteredMember(u); f1.Show(); }
private void ResisterButtonClicked(object sender, EventArgs e) { if (textBoxPassword.Text == textBoxRepass.Text) { string errors = ""; errors += textBoxName.Text.Length == 0 ? "Please Provide Name": ""; errors += textBoxPassword.Text.Length == 0 ? "\nPlease Provide Password" : ""; errors += textBoxRepass.Text.Length == 0 ? "\nPlease provide Retype password" : ""; errors += pictureBoxProfilePicture == null ? "\nPlease upload profile picture" : ""; errors += textBoxUsername.Text.Length == 0 ? "\nPlease Provide User Name" : ""; errors += textBoxAddress.Text.Length == 0 ? "\nPlease Provide Address" : ""; errors += textBoxEmail.Text.Length == 0 ? "\nPlease Provide Gmail" : ""; errors += comboBoxBloodGroup.Text == null ? "\nPlease Provide Blood Group":""; if (!radioButtonFemale.Checked && !radioButtonMale.Checked) { errors += "\nPlease Provide Gender"; } errors += (textBoxMobileNumber.Text.Length == 0 || textBoxMobileNumber.Text.Length != 11) ? "\nPlease Provide a Valid Mobile Number" : ""; errors += textBoxProfession.Text.Length == 0 ? "\n Please Provide Profession" : ""; if (errors.Length != 0) { MessageBox.Show(errors, "Filled the flowing!"); return; } else { string gend = radioButtonFemale.Checked ? "Female" : "Male"; byte[] img = null; string imgLoc = pictureBoxProfilePicture.ImageLocation; FileStream fs = new FileStream(imgLoc, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fs); img = br.ReadBytes((int)fs.Length); var res = ResisterController.ResisterMember(textBoxName.Text, textBoxUsername.Text, textBoxPassword.Text, comboBoxBloodGroup.Text, dateTimePickerDob.Value, textBoxMobileNumber.Text, textBoxProfession.Text, gend, textBoxEmail.Text, textBoxAddress.Text, img); if (!res) { } else { MessageBox.Show("Successfully registered", "Message"); this.Hide(); Login f1 = new Login(); f1.Show(); } } } else { MessageBox.Show("Password and Re-enter password must be same!", "Allert"); } }
private void SearchButtonClick(object sender, EventArgs e) { if (comboBoxBloodGroup.SelectedItem != null) { string bldgrp = comboBoxBloodGroup.SelectedItem.ToString(); Console.WriteLine(bldgrp); var member = ResisterController.GetMember(bldgrp); dataGridViewMember.DataSource = member; } else { MessageBox.Show("All information must be filled", "Alert"); } }
private void RegisterClickEvent(object sender, EventArgs e) { if (textBoxPassword.Text == textBoxRepass.Text) { string errors = ""; errors += textBoxName.Text.Length == 0 ? "Please Provide Name" : ""; errors += textBoxPassword.Text.Length == 0 ? "\nPlease Provide Password" : ""; errors += textBoxRepass.Text.Length == 0 ? "\nPlease provide Retype password" : ""; errors += textBoxUsername.Text.Length == 0 ? "\nPlease Provide User Name" : ""; errors += textBoxAddress.Text.Length == 0 ? "\nPlease Provide Address" : ""; errors += textBoxEmail.Text.Length == 0 ? "\nPlease Provide Gmail" : ""; errors += comboBoxBloodGroup.SelectedItem == null ? "\nPlease Provide Blood Group" : ""; if (!radioButtonFemale.Checked && !radioButtonMale.Checked) { errors += "\nPlease Provide Gender"; } errors += textBoxProfession.Text.Length == 0 ? "\n Please Provide Profession" : ""; if (errors.Length != 0) { MessageBox.Show(errors, "Filled the flowing!"); return; } else { string gend = radioButtonFemale.Checked ? "Female" : "Male"; string a = dateTimePickerDob.Text; var res = ResisterController.ResisterMember(textBoxName.Text, textBoxUsername.Text, textBoxPassword.Text, comboBoxBloodGroup.Text, dateTimePickerDob.Value, textBoxProfession.Text, gend, textBoxEmail.Text, textBoxAddress.Text, a); if (!res) { } else { MessageBox.Show("Successfully registered", "Message"); this.Hide(); Login f1 = new Login(); f1.Show(); } } } else { MessageBox.Show("Password and Re-enter password must be same!", "Allert"); } }
private void buttonBloodStock_Click(object sender, EventArgs e) { if (textBox1.Text != "") { var res = ResisterController.updatepermission(b, c); if (!res) { } else { MessageBox.Show("Permission Changed", "Message"); textBox1.Text = ""; var member = ResisterController.GetAllMember(); dataGridViewMember.DataSource = member; } } else { MessageBox.Show("Select User to manage", "Alert"); } }
private void buttonUpdate_Click(object sender, EventArgs e) { string a, b = ""; var res = ResisterController.GetMemberuname(u.Username); if (textBoxAddress.Text.Length == 0 && textBoxEmail.Text.Length == 0) { MessageBox.Show("Provide at least one information to Update", "Alert"); } else { if (textBoxAddress.Text.Length == 0) { a = res.Address; b = textBoxEmail.Text; } else if (textBoxEmail.Text.Length == 0) { a = textBoxAddress.Text; b = res.Gmail; } else { a = textBoxAddress.Text; b = textBoxEmail.Text; } int result = ResisterController.UpdateInfo(u.Username, b, a); if (result != 0) { textBoxAddress.Text = null; textBoxEmail.Text = null; MessageBox.Show("Successfully updated!", "Message"); } } }
private void MemberInfoLoad(object sender, EventArgs e) { var member = ResisterController.GetAllMember(); dataGridViewMember.DataSource = member; }