Beispiel #1
0
        /// <summary>
        /// 添加报名信息
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public CommandResult <int> AddEntry(AddEntryArgs args)
        {
            ArgumentHelper.Require(args.SchoolId, "SchoolId", Arguments.Positive);
            ArgumentHelper.Require(args.CreateBy, "CreateBy", Arguments.Positive);
            ArgumentHelper.Require(args.ModifyBy, "ModifyBy", Arguments.Positive);

            return(ContainerFactory <IEntryRepository> .Instance.AddEntry(args));
        }
Beispiel #2
0
        public string AddEntry(AddEntryArgs model)
        {
            if (model != null)
            {
                model.CreateBy = ApplicationContext.UserId;
                model.ModifyBy = ApplicationContext.UserId;
                model.SchoolId = ApplicationContext.SchoolId;

                var result = EntryService.Instance.AddEntry(model);
                return(JsonHelper.Serialize(result));
            }
            return(JsonHelper.Serialize(CommandResult.Failure <int>()));
        }
Beispiel #3
0
        public CommandResult <int> AddEntry(AddEntryArgs args)
        {
            try
            {
                var result = ContainerFactory <ISqlExcuteContext> .Instance.ExcuteQueryProcedure <int>(args.SchoolId, "add_entry", 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, e);
                return(CommandResult.Failure <int>(e.ToString()));
            }
        }