public ActionResult GetAll() { NurseService d = new NurseService(); var res = d.GetAllNurse(); return(Json(res)); }
public ActionResult Delete(string nurse_ID) { NurseService d = new NurseService(); d.DeleteNurseByID(nurse_ID); return(Json(1)); }
public ActionResult SearchIDe(string nurse_ID) { NurseService d = new NurseService(); var res = d.GetNurseByIDe(nurse_ID); return(Json(res, JsonRequestBehavior.AllowGet)); }
public ActionResult Query(string nurse_ID) { NurseService nurserve = new NurseService(); var QResult = nurserve.QueryByID(nurse_ID); return(Json(QResult, JsonRequestBehavior.AllowGet)); }
public ActionResult Display() { NurseService nurserve = new NurseService(); var QResult = nurserve.DisplayNurseSalary(); return(Json(QResult, JsonRequestBehavior.AllowGet)); }
public HomeController(NurseService nurseService, HospitalService hospitalService) { _nurseService = nurseService; _hospitalService = hospitalService; _prefixNurse = "nurse"; _prefixHospital = "hospital"; }
public ActionResult Change(string prenurse_ID, string nurse_ID, string nurse_name, string nurse_dept, string position, string sex, int salary) { NurseService d = new NurseService(); var res = d.ChangeNurseByID(prenurse_ID, nurse_ID, nurse_name, nurse_dept, position, sex, salary); return(Json(res, JsonRequestBehavior.AllowGet)); }
public ActionResult AddNew(string nurse_ID, string nurse_name, string nurse_dept, string position, string sex, int salary) { NurseService d = new NurseService(); var res = d.AddNewNurse(nurse_ID, nurse_name, nurse_dept, position, sex, salary); return(Json(res)); }
// GET: Nurse public ActionResult Index() { using (MyContext ctx = new MyContext()) { NurseService d = new NurseService(); //d.AddNewNurse("111", "2", "3", "4", "5", 6000); var res = d.GetAllNurse(); return(View(res)); } }
public ActionResult RtSalary() { List <float> salalist = new List <float>(); DoctorService docserve = new DoctorService(); NurseService nurserve = new NurseService(); float total1 = docserve.RetrunDoctorTotalSalary(); float total2 = nurserve.ReturnNurseTotalSalary(); salalist.Add(total1 + total2); return(Json(salalist)); }
//护士账号注册 public ActionResult ManAdd1(string nurseID, string nurseName, string nursePassword, string nursePosition, string nurseDept_name, string nurseGender) { accountService accountS = new accountService(); NurseService nurseService = new NurseService(); account account = new account(); if (accountS.AddNew1(nurseID, nursePassword, nurseName, "Nurse") == false) { return(Json("账号已存在,请重新注册"));//ToDo } account.user_ID = nurseID; account.name = nurseName; nurseService.AddNew(account, nurseDept_name, nursePosition, 0, nurseGender); //返回值待定 return(Json("注册成功")); }
public NursesController(NurseService nurseService) { this.nurseService = nurseService; }
public NurseController() { nurseService = new NurseService(new NurseDao()); }
public NurseController(NurseService nurseService) { _nurseService = nurseService; _prefix = "nurse"; _prefixHospital = "hospital"; }
private void Button1_Click(object sender, EventArgs e) { user objUser; objUser = userService.GetUserByUsername(txtUsername.Text.ToLower()); //validar tipo if (cmbTypeOfUser.SelectedIndex == -1) { MessageBox.Show("Select a type of user"); } //Validar si existe else if (objUser == null) { MessageBox.Show("Username incorrect"); } //Validar Contraseña else if (objUser.password == txtPassword.Text) { String userString = txtUsername.Text.ToString(); username = userString; int dni = Int32.Parse(userString.Substring(1)); String name = personService.GetPersonByDni(dni).name; MessageBox.Show("Welcome " + name); String path = @"C:\Users\anthony\source\repos\ClinicPlus\Logs.txt"; int userid = objUser.id; idUsuario = userid; String type = cmbTypeOfUser.SelectedItem.ToString(); if (!File.Exists(path)) { File.Create(path); TextWriter tw = new StreamWriter(path); tw.WriteLine(type + " " + username + " " + DateTime.Now); tw.WriteLine(); tw.Close(); } else if (File.Exists(path)) { using (var tw = new StreamWriter(path, true)) { tw.WriteLine(type + " " + username + " " + DateTime.Now); } } if (type.Equals("Admin")) { IAdminService adminService = new AdminService(); if (adminService.GetAdminByUserId(userid) == null) { MessageBox.Show("Access Denied"); } else { this.Hide(); FrmAdministrador.Show(); } } else if (type.Equals("Nurse")) { INurseService nurService = new NurseService(); if (nurService.GetNurseByUserId(userid) == null) { MessageBox.Show("Access Denied"); } else { this.Hide(); FrmNurses.Show(); } } else if (type.Equals("Doctor")) { IDoctorService docService = new DoctorService(); if (docService.GetDoctorByUserId(userid) == null) { MessageBox.Show("Access Denied"); } else { this.Hide(); FrmDoctor.Show(); } } } else { MessageBox.Show("Password or username incorrect"); } }