Ejemplo n.º 1
0
        public ReturnResult <StudySchedule> Add(AddStudyScheduleModel studySchedule)
        {
            DbProvider dbProvider = new DbProvider();
            string     outCode    = String.Empty;
            string     outMessage = String.Empty;
            StoredProcedureConfigs <StudySchedule> storedProcedureConfigs = new StoredProcedureConfigs <StudySchedule>();

            dbProvider.SetQuery(storedProcedureConfigs._INSERT_SINGLE_STORED_PROCEDURE, CommandType.StoredProcedure)
            .SetParameter("StartDate", SqlDbType.DateTime, studySchedule.StartDate, ParameterDirection.Input)
            .SetParameter("EndDate", SqlDbType.DateTime, studySchedule.EndDate, ParameterDirection.Input)
            .SetParameter("ClassId", SqlDbType.Int, studySchedule.ClassId, ParameterDirection.Input)
            .SetParameter("ComputerRoomId", SqlDbType.Int, studySchedule.ComputerRoomId, ParameterDirection.Input)
            .SetParameter("ShiftId", SqlDbType.Int, studySchedule.ShiftId, ParameterDirection.Input)
            .SetParameter("SubjectId", SqlDbType.Int, studySchedule.SubjectId, ParameterDirection.Input)
            .SetParameter("TeacherId", SqlDbType.Int, studySchedule.TeacherId, ParameterDirection.Input)
            .SetParameter("DayOfWeek", SqlDbType.Int, studySchedule.DayOfWeek, ParameterDirection.Input)
            .SetParameter("EmployeeId", SqlDbType.Int, studySchedule.EmployeeId, ParameterDirection.Input)
            .SetParameter("Status", SqlDbType.Int, studySchedule.Status, ParameterDirection.Input)
            .SetParameter("CreatedBy", SqlDbType.NVarChar, studySchedule.CreatedBy, ParameterDirection.Input)
            .SetParameter("ERROR_CODE", SqlDbType.NVarChar, DBNull.Value, 100, ParameterDirection.Output)
            .SetParameter("ERROR_MESSAGE", SqlDbType.NVarChar, DBNull.Value, 400, ParameterDirection.Output)
            .ExcuteNonQuery()
            .Complete();
            dbProvider.GetOutValue("ERROR_CODE", out outCode)
            .GetOutValue("ERROR_MESSAGE", out outMessage);
            return(new ReturnResult <StudySchedule>()
            {
                ErrorCode = outCode,
                ErrorMessage = outMessage,
            });
        }
        public IActionResult Add(AddStudyScheduleModel shift)
        {
            StudyScheduleBusiness shiftBusiness = new StudyScheduleBusiness();
            var result = shiftBusiness.AddStudySchedule(shift);

            return(Ok(result));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> Add(AddStudyScheduleModel StudySchedule)
        {
            StudySchedule.CreatedBy = _userSessionHelper.GetUserSession().UserName;
            string apiUrl = _appUrlHelper.GetApiUrl(ApiUrlPath.STUDY_SCHEDULE_ADD);
            var    result = await HttpUtilities.PostAsyncApi <ReturnResult <StudySchedule> >(apiUrl, JsonConvert.SerializeObject(StudySchedule));

            return(Json(result));
        }
Ejemplo n.º 4
0
 public ReturnResult <StudySchedule> AddStudySchedule(AddStudyScheduleModel mouse)
 {
     return(StudyScheduleDAL.Add(mouse));
 }