Esempio n. 1
0
        public async Task <TData <string> > SaveForm(DetailsEntity entity)
        {
            TData <string> obj = new TData <string>();
            await detailsService.SaveForm(entity);

            obj.Result = entity.Id.ParseToString();
            obj.Tag    = 1;
            return(obj);
        }
        public async Task <ActionResult> SaveFormJsonMoney(DetailsEntity entity)
        {
            TData <DetailsEntity> obj = await detailsBLL.GetEntity(Convert.ToInt64(entity.Id));

            if (obj.Tag == 1)
            {
                obj.Result.Money = entity.Money;
                TData <string> objstr = await detailsBLL.SaveForm(obj.Result);

                return(Json(objstr));
            }
            return(Json(obj));
        }
Esempio n. 3
0
        public async Task DeleteForm(string ids)
        {
            long[] idArr = TextHelper.SplitToArray <long>(ids, ',');
            foreach (var id in idArr)
            {
                DetailsEntity entity = new DetailsEntity();
                await entity.Modify();

                entity.Id           = id;
                entity.BaseIsDelete = 1;
                await this.BaseRepository().Update <DetailsEntity>(entity);
            }
            //await this.BaseRepository().Delete<DetailsEntity>(idArr);
        }
Esempio n. 4
0
        public async Task SaveForm(DetailsEntity entity)
        {
            if (entity.Id.IsNullOrZero())
            {
                await entity.Create();

                await this.BaseRepository().Insert(entity);
            }
            else
            {
                await entity.Modify();

                await this.BaseRepository().Update(entity);
            }
        }
        public async Task <ActionResult> SaveFormJson(DetailsEntity entity)
        {
            OperatorInfo operatorInfo = await Operator.Instance.Current();

            entity.SysDepartmentId   = operatorInfo.DepartmentId;
            entity.SysDepartmentName = operatorInfo.DepartmentName;

            TData <string> obj      = new TData <string>();
            var            codelist = entity.StudentCode.Split(',');

            if (codelist.Contains("0"))//选择全部学生
            {
                StudentInfoListParam param = new StudentInfoListParam();
                param.SysDepartmentId = operatorInfo.DepartmentId;
                TData <List <StudentInfoEntity> > stuobj = await studentInfoBLL.GetList(param);

                if (stuobj.Tag == 1 && stuobj.Result.Any())
                {
                    foreach (var stumodel in stuobj.Result)//多选学生添加
                    {
                        entity.StudentCode = stumodel.Code;
                        entity.Id          = 0;
                        entity.Status      = 1;
                        obj = await detailsBLL.SaveForm(entity);
                    }
                }
            }
            else if (codelist.Count() > 1)
            {
                foreach (var code in codelist)//多选学生添加
                {
                    entity.StudentCode = code;
                    entity.Id          = 0;
                    entity.Status      = 1;
                    obj = await detailsBLL.SaveForm(entity);
                }
            }
            else
            {
                entity.Status = 1;
                obj           = await detailsBLL.SaveForm(entity);
            }
            return(Json(obj));
        }