Esempio n. 1
0
 /// <summary>
 /// 添加课时
 /// </summary>
 /// <param name="args"></param>
 /// <returns></returns>
 public CommandResult <int> AddAttendClass(AddAttendClassArgs args)
 {
     ArgumentHelper.Require(args.SchoolId, "SchoolId", Arguments.Positive);
     ArgumentHelper.Require(args.CreateBy, "CreateBy", Arguments.Positive);
     ArgumentHelper.Require(args.ModifyBy, "ModifyBy", Arguments.Positive);
     return(ContainerFactory <IClassesRepository> .Instance.AddAttendClass(args));
 }
Esempio n. 2
0
 public string AddAttendClass(AddAttendClassArgs model)
 {
     if (model != null)
     {
         model.CreateBy = ApplicationContext.UserId;
         model.ModifyBy = ApplicationContext.UserId;
         model.SchoolId = ApplicationContext.SchoolId;
         var result = ClassesService.Instance.AddAttendClass(model);
         return(JsonHelper.Serialize(result));
     }
     return(JsonHelper.Serialize(CommandResult.Failure <int>()));
 }
Esempio n. 3
0
        public CommandResult <int> AddAttendClass(AddAttendClassArgs args)
        {
            try
            {
                var result = ContainerFactory <ISqlExcuteContext> .Instance.ExcuteQueryProcedure <int>(args.SchoolId, "add_attend_class", args);

                if (result.Code == 200 && result.Items.Count > 0)
                {
                    return(CommandResult.Success(result.Items[0]));
                }
                return(CommandResult.Failure <int>());
            }
            catch (Exception e)
            {
                LogHelper.Error(this.GetType(), "班级管理-添加上课时间,SchoolId:" + args.SchoolId + ",学校编号:" + args.SchoolId, e);
                return(CommandResult.Failure <int>(e.ToString()));
            }
        }
Esempio n. 4
0
        public string AddAttendClasses(AddAttendClassArgs[] models)
        {
            for (int i = 0; i < models.Length; i++)
            {
                AddAttendClassArgs model = models[i];
                if (model != null)
                {
                    model.BeginTime = model.BeginTime;
                    model.EndTime   = model.EndTime;
                    model.CreateBy  = ApplicationContext.UserId;
                    model.ModifyBy  = ApplicationContext.UserId;
                    model.SchoolId  = ApplicationContext.SchoolId;

                    var result = ClassesService.Instance.AddAttendClass(model);
                }
            }
            return(JsonHelper.Serialize(CommandResult.Failure <int>()));
        }