protected void Button1_Click(object sender, EventArgs e) { string empUsername = TextBox1.Text; string empPassword = TextBox2.Text; Common_LoginBL objLoginBL = new Common_LoginBL(); int empId = objLoginBL.Common_Login(empUsername, empPassword); if (empId == 0) { Label1.Text = "Invalid Username/Password"; Label1.Visible = true; Label1.ForeColor = System.Drawing.Color.Red; TextBox1.BackColor = System.Drawing.Color.Pink; TextBox2.BackColor = System.Drawing.Color.Pink; } else { Session["empType"] = "Doctor"; Session["doctorId"] = empId; Session["doctorUsername"] = empUsername; Session["doctorPassword"] = empPassword; Common_GetLastLoginBL objCommon_GetLastLoginBL = new Common_GetLastLoginBL(); Session["doctortLastLogin"] = objCommon_GetLastLoginBL.Common_GetLastLogin(empId); Common_AddLastLoginBL objAddLastLoginBL = new Common_AddLastLoginBL(); objAddLastLoginBL.Common_AddLastLogin(empId); Session.Timeout = 24 * 60; Response.Redirect("DoctorHome.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { string empUsername = TextBox1.Text; string empPassword = TextBox2.Text; Common_LoginBL objLoginBL = new Common_LoginBL(); int empId = objLoginBL.Common_Login(empUsername, empPassword); if (empId == 0) { Label1.Text = "Invalid Username/Password"; Label1.Visible = true; Label1.ForeColor = System.Drawing.Color.Red; TextBox1.BackColor = System.Drawing.Color.Pink; TextBox2.BackColor = System.Drawing.Color.Pink; } else { Session["empType"] = "Receptionist"; Session["receptionistId"] = empId; Session["receptionistUsername"] = empUsername; Session["receptionistPassword"] = empPassword; Common_GetLastLoginBL objCommon_GetLastLoginBL = new Common_GetLastLoginBL(); Session["receptionistLastLogin"] = objCommon_GetLastLoginBL.Common_GetLastLogin(empId); Common_AddLastLoginBL objAddLastLoginBL = new Common_AddLastLoginBL(); objAddLastLoginBL.Common_AddLastLogin(empId); Session.Timeout = 24 * 60; Response.Redirect("ReceptionistHome.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { int empNamePrefix = Convert.ToInt32(DropDownList3.SelectedValue); string empFirstName = TextBox1.Text; string empLastName = TextBox2.Text; int empGender = Convert.ToInt32(DropDownList1.SelectedIndex); string empDOB = TextBox3.Text; string empStreetAddress = TextBox4.Text; string empCity = TextBox5.Text; int empZipCode = Convert.ToInt32(TextBox11.Text); string empState = TextBox6.Text; string empCountry = DropDownList2.Text; string empPrimaryPhoneNumber = TextBox7.Text; string empSecondaryPhoneNumber = TextBox8.Text; string empEmailAddress = TextBox9.Text; string empPanId = TextBox10.Text; int empType = 2; string empDateOfJoin = TextBox18.Text; string empDateOfLeave = ""; int empBank = Convert.ToInt32(DropDownList5.SelectedIndex); string empAccountNumber = TextBox19.Text; string empShiftStart = TextBox20.Text; string empShiftEnd = TextBox21.Text; RegisterEmployeeBL objRegisterEmployeeBL = new RegisterEmployeeBL(); /*int receptionistEmpId = objRegisterEmployeeBL.RegisterEmployee(empNamePrefix, empFirstName, empLastName, * empGender, empDOB, empStreetAddress, empCity, empZipCode, empState, empCountry, * empPrimaryPhoneNumber, empSecondaryPhoneNumber, empEmailAddress, empPanId, empType, * empDateOfJoin, empDateOfLeave, empBank, empAccountNumber, empShiftStart, empShiftEnd);*/ string marks10 = TextBox10.Text; string marks12 = TextBox12.Text; RegisterEmployeeReceptionistBL objRegisterEmployeeReceptionistBL = new RegisterEmployeeReceptionistBL(); //int receptionistId = objRegisterEmployeeReceptionistBL.RegisterEmployeeReceptionist(receptionistEmpId, marks10, marks12); //string receptionistUsername = "******" + receptionistEmpId; var chars = "abcdefghijklmnopqrstuvwxyz0123456789"; var stringChars = new char[8]; var random = new Random(); for (int i = 0; i < stringChars.Length; i++) { stringChars[i] = chars[random.Next(chars.Length)]; } var receptionistPassword = new String(stringChars); //Label1.Text="Receptionist account created successfuly. <br />Username is <b>" + receptionistUsername + "</b> and temporary Password is <b>" + receptionistPassword + "</b>"; Label1.Visible = true; Common_LoginBL objLoginBL = new Common_LoginBL(); //objLoginBL.Common_InsertTemporaryLogin(receptionistEmpId, receptionistUsername, receptionistPassword); }
protected void Button1_Click(object sender, EventArgs e) { int empNamePrefix = Convert.ToInt32(DropDownList3.SelectedValue); string empFirstName = TextBox1.Text; string empLastName = TextBox2.Text; int empGender = Convert.ToInt32(DropDownList1.SelectedIndex); string empDOB = TextBox3.Text; string empStreetAddress = TextBox4.Text; string empCity = TextBox5.Text; int empZipCode = Convert.ToInt32(TextBox11.Text); string empState = TextBox6.Text; string empCountry = DropDownList2.Text; string empPrimaryPhoneNumber = TextBox7.Text; string empSecondaryPhoneNumber = TextBox8.Text; string empEmailAddress = TextBox9.Text; string empPanId = TextBox10.Text; int empType = 2; string empDateOfJoin = TextBox18.Text; string empDateOfLeave = ""; int empBank = Convert.ToInt32(DropDownList5.SelectedIndex); string empAccountNumber = TextBox19.Text; string empShiftStart = TextBox20.Text; string empShiftEnd = TextBox21.Text; RegisterEmployeeBL objRegisterEmployeeBL = new RegisterEmployeeBL(); /*int receptionistEmpId = objRegisterEmployeeBL.RegisterEmployee(empNamePrefix, empFirstName, empLastName, empGender, empDOB, empStreetAddress, empCity, empZipCode, empState, empCountry, empPrimaryPhoneNumber, empSecondaryPhoneNumber, empEmailAddress, empPanId, empType, empDateOfJoin, empDateOfLeave, empBank, empAccountNumber, empShiftStart, empShiftEnd);*/ string marks10 = TextBox10.Text; string marks12 = TextBox12.Text; RegisterEmployeeReceptionistBL objRegisterEmployeeReceptionistBL = new RegisterEmployeeReceptionistBL(); //int receptionistId = objRegisterEmployeeReceptionistBL.RegisterEmployeeReceptionist(receptionistEmpId, marks10, marks12); //string receptionistUsername = "******" + receptionistEmpId; var chars = "abcdefghijklmnopqrstuvwxyz0123456789"; var stringChars = new char[8]; var random = new Random(); for (int i = 0; i < stringChars.Length; i++) { stringChars[i] = chars[random.Next(chars.Length)]; } var receptionistPassword = new String(stringChars); //Label1.Text="Receptionist account created successfuly. <br />Username is <b>" + receptionistUsername + "</b> and temporary Password is <b>" + receptionistPassword + "</b>"; Label1.Visible = true; Common_LoginBL objLoginBL = new Common_LoginBL(); //objLoginBL.Common_InsertTemporaryLogin(receptionistEmpId, receptionistUsername, receptionistPassword); }