public ActionResult DutySave(ReceptionistDutyModel receptionistDuty) { ViewBag.receptionistList = receptionistManager.GetAllReceptionist(); ViewBag.shiftList = nurseDutyScheduleManager.GetAllShift(); ViewBag.message = receptionistManager.DutySave(receptionistDuty); ModelState.Clear(); return(View()); }
//---------------------------Duty---------------------------------------------------- public string DutySave(ReceptionistDutyModel receptionistDuty) { int rowEffect = receptionistGateway.DutySave(receptionistDuty); if (rowEffect > 0) { return("Save Successful"); } else { return("Save Faild"); } }
//---------------------------Duty---------------------------------------------------- public int DutySave(ReceptionistDutyModel receptionistDuty) { query = "INSERT INTO ReceptionistDutyTable VALUES( '" + receptionistDuty.ReceptionistId + "', '" + receptionistDuty.Date + "', '" + receptionistDuty.ShiftId + "' )"; Command = new SqlCommand(query, Connection); Connection.Open(); int rowEffect = Command.ExecuteNonQuery(); Connection.Close(); return(rowEffect); }