// PUT: api/Nurse/5 //Put action, which accepts int and nurse Business object as parameters and void as return type public void Put(int id, [FromBody] NurseBO nurseBO) { NurseBLLFactory nurseBLLFactory = new NurseBLLFactory(); string nurse = nurseBLLFactory.CreateNurseBLL().UpdateNurseDetailsBLL().CreateNurseDAL().UpdateDetails_DAL(nurseBO); string activateNurse = nurseBLLFactory.CreateNurseBLL().ActivateNurseBLL().CreateNurseDAL().ActivateAccount_DAL(nurseBO); string deactivateNurse = nurseBLLFactory.CreateNurseBLL().DeActivateNurseBLL().CreateNurseDAL().DeActivateAccount_DAL(nurseBO); }
public string UserForgotPassword(Person _person) { var result = ""; if (_person.pid == 1) { AdministratorBLLFactory admin = new AdministratorBLLFactory(); AdministratorBO adminBO = new AdministratorBO(); adminBO.emailID = _person.emailID; result = admin.CreateAdministratorBLL().ValidateAdminBLL().CreateAdminstratorDAL().ValidateEmailAdmin_DAL(_person.emailID); } else if (_person.pid == 2) { PatientBLLFactory patient = new PatientBLLFactory(); PatientBO patientBO = new PatientBO(); patientBO.emailID = _person.emailID; result = patient.CreatePatientBLL().ValidatePatientBLL().CreatePatientDAL().ValidateEmailPatient_DAL(patientBO); } else if (_person.pid == 3) { DoctorBLLFactory doctor = new DoctorBLLFactory(); DoctorBO doctorBO = new DoctorBO(); doctorBO.emailID = _person.emailID; result = doctor.CreateDoctorBLL().ValidateDoctorBLL().CreateDoctorDAL().ValidateEmailDoctor_DAL(doctorBO); } else if (_person.pid == 4) { NurseBLLFactory nurse = new NurseBLLFactory(); NurseBO nurseBO = new NurseBO(); nurseBO.emailID = _person.emailID; result = nurse.CreateNurseBLL().ValidateNurse().CreateNurseDAL().ValidateNurse_DAL(nurseBO); } else if (_person.pid == 5) { LabInchargeBLLFactory incharge = new LabInchargeBLLFactory(); LabInchargeBO inchargeBO = new LabInchargeBO(); inchargeBO.emailID = _person.emailID; result = incharge.CreateLabInchargeBLL().ValidateLabInchargeBLL().CreateLabInchargeDAL().ValidateLabIncharge_DAL(inchargeBO); } if ((result) != "false" && result != "" && result != null) { EmailController email = new EmailController(); email.SendForgotPasswordEmail(result, _person.emailID); return("Sent Password to Email"); } else { return("User Do not exist"); } }
public string RegisterNewNurse(NurseBO nurseBO) { NurseBLLFactory nurseBLLFactory = new NurseBLLFactory(); NurseBO nurse_BO = nurseBLLFactory.CreateNurseBLL().InsertNewNurseBLL().CreateNurseDAL().InsertNurseDetails_DAL(nurseBO); if (nurse_BO.pid != 0) { return("Your new User ID " + Convert.ToString(nurse_BO.pid) + " - Login Using this UserID"); } return("Email ID is already Used by other User, try using other EmailID"); }
// GET: api/Nurse/5 //Get action which accepts int and string as parameters, with nurse business object as return type public NurseBO Get(int id, string pwd) { NurseBLLFactory nurseBLLFactory = new NurseBLLFactory(); NurseBO nurseBO = new NurseBO(); nurseBO.pid = id; nurseBO.pwd = pwd; nurseBO = nurseBLLFactory.CreateNurseBLL().GetNurseDetails().CreateNurseDAL().GetNurseDetails_DAL(nurseBO); return(nurseBO); }
public string GetUserName(int id) { string response = "No Name"; if (id > 3000 && id < 4000) { NurseBO nurseBo = new NurseBO(); nurseBo.pid = id; NurseBLLFactory validatenurseBLLFactory = new NurseBLLFactory(); var NurseDetails = validatenurseBLLFactory.CreateNurseBLL().ValidateNurse().CreateNurseDAL().GetAllNurses_DAL().Where(d => d.pid == id).FirstOrDefault(); return(NurseDetails.firstName); } else if (id > 4000 && id < 5000) { LabInchargeBO inchargeBo = new LabInchargeBO(); inchargeBo.pid = id; LabInchargeBLLFactory validateInchargeBLLFacotry = new LabInchargeBLLFactory(); var inchargeDetails = validateInchargeBLLFacotry.CreateLabInchargeBLL().ValidateLabInchargeBLL().CreateLabInchargeDAL().GetAllLabInchargeDetials_DAL().Where(d => d.pid == id).FirstOrDefault(); return(inchargeDetails.firstName); } else if (id > 5000 && id < 6000) { DoctorBO doctorBO = new DoctorBO(); doctorBO.pid = id; DoctorBLLFactory doctorBLLFactory = new DoctorBLLFactory(); return(doctorBLLFactory.CreateDoctorBLL().ValidateDoctorBLL().CreateDoctorDAL().GetDoctorDetails_DAL(doctorBO).firstName); } else if (id > 6000 && id < 7000) { AdministratorBO adminBO = new AdministratorBO(); adminBO.pid = id; AdministratorBLLFactory adminBLLFactory = new AdministratorBLLFactory(); return(adminBLLFactory.CreateAdministratorBLL().ValidateAdminBLL().CreateAdminstratorDAL().GetAdminDetailsByID_DAL(adminBO).firstName); } else if (id > 7000 && id < 8000) { PatientBO patientBO = new PatientBO(); patientBO.pid = id; PatientBLLFactory patientBLLFactory = new PatientBLLFactory(); return(patientBLLFactory.CreatePatientBLL().ValidatePatientBLL().CreatePatientDAL().GetPatientDetialsByID(patientBO).FirstOrDefault().firstName); } return(response); }
public int Authenticate(int id, string pwd) { int response = -1; if (id > 3000 && id < 4000) { NurseBO nurseBo = new NurseBO(); nurseBo.pid = id; nurseBo.pwd = pwd; NurseBLLFactory validatenurseBLLFactory = new NurseBLLFactory(); string validateNurse = validatenurseBLLFactory.CreateNurseBLL().ValidateNurse().CreateNurseDAL().ValidateNurse_DAL(nurseBo); if (validateNurse.Equals("True")) { response = 1; } else if (validateNurse.Equals("False")) { response = 0; } } else if (id > 4000 && id < 5000) { LabInchargeBO inchargeBo = new LabInchargeBO(); inchargeBo.pid = id; inchargeBo.pwd = pwd; LabInchargeBLLFactory validateInchargeBLLFacotry = new LabInchargeBLLFactory(); string validateIncharge = validateInchargeBLLFacotry.CreateLabInchargeBLL().ValidateLabInchargeBLL().CreateLabInchargeDAL().ValidateLabIncharge_DAL(inchargeBo); if (validateIncharge.Equals("True")) { response = 2; } else if (validateIncharge.Equals("False")) { response = 0; } } else if (id > 5000 && id < 6000) { DoctorBO doctorBO = new DoctorBO(); doctorBO.pid = id; doctorBO.pwd = pwd; DoctorBLLFactory doctorBLLFactory = new DoctorBLLFactory(); string validateDoctor = doctorBLLFactory.CreateDoctorBLL().ValidateDoctorBLL().CreateDoctorDAL().ValidateDoctor_DAL(doctorBO); if (validateDoctor.Equals("True")) { response = 3; } else if (validateDoctor.Equals("False")) { response = 0; } } else if (id > 6000 && id < 7000) { AdministratorBO adminBO = new AdministratorBO(); adminBO.pid = id; adminBO.pwd = pwd; AdministratorBLLFactory adminBLLFactory = new AdministratorBLLFactory(); string validateAdmin = adminBLLFactory.CreateAdministratorBLL().ValidateAdminBLL().CreateAdminstratorDAL().ValidateAdmin_DAL(adminBO); if (validateAdmin.Equals("True")) { response = 4; } else if (validateAdmin.Equals("False")) { response = 0; } } else if (id > 7000 && id < 8000) { PatientBO patientBO = new PatientBO(); patientBO.pid = id; patientBO.pwd = pwd; PatientBLLFactory patientBLLFactory = new PatientBLLFactory(); string validatePatient = patientBLLFactory.CreatePatientBLL().ValidatePatientBLL().CreatePatientDAL().ValidatePatient_DAL(patientBO); if (validatePatient.Equals("True")) { response = 5; } else if (validatePatient.Equals("False")) { response = 0; } } return(response); }
// POST: api/Nurse //Post action which accepts nurse buisness object as parameter and void as return type public void Post([FromBody] NurseBO nurseBO) { NurseBLLFactory nurseBLLFactory = new NurseBLLFactory(); NurseBO nurse_BO = nurseBLLFactory.CreateNurseBLL().InsertNewNurseBLL().CreateNurseDAL().InsertNurseDetails_DAL(nurseBO); }
public IEnumerable <NurseBO> GetAllNurses() { NurseBLLFactory nurseBLLFactory = new NurseBLLFactory(); return(nurseBLLFactory.CreateNurseBLL().UpdateNurseDetailsBLL().CreateNurseDAL().GetAllNurses_DAL()); }
public IEnumerable <NurseBO> UpdateNurse(NurseBO nurseBO) { NurseBLLFactory nurseBLLFactory = new NurseBLLFactory(); return(nurseBLLFactory.CreateNurseBLL().UpdateNurseDetailsBLL().CreateNurseDAL().UpdateNurseDetails_DAL(nurseBO)); }