示例#1
0
        public async Task <ObjectResultModule> CreateOrderEarlyWarning([FromBody] OrderEarlyWarning input)
        {
            if (!Commons.CheckSecret(input.Secret))
            {
                this.ObjectResultModule.StatusCode = 422;
                this.ObjectResultModule.Message    = "Wrong Secret";
                this.ObjectResultModule.Object     = "";
                return(this.ObjectResultModule);
            }
            var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0;
            var create = new OrderEarlyWarning()
            {
                ConsultNumber     = input.ConsultNumber,
                ConsultID         = input.ConsultID,
                OrderID           = input.OrderID,
                OrderNumber       = input.OrderNumber,
                ConsultantID      = input.ConsultantID,
                ConsultantName    = input.ConsultantName,
                PatientID         = input.PatientID,
                PatientName       = input.PatientName,
                DoctorID          = input.DoctorID,
                DoctorName        = input.DoctorName,
                RemindState       = input.RemindState,
                RemindDescription = input.RemindDescription,
                CreatedBy         = userid,
                CreatedOn         = DateTime.Now
            };
            var res = await _OrderEarlyWarningService.CreateOrderEarlyWarning(create);

            if (res.Id > 0)
            {
                this.ObjectResultModule.StatusCode = 200;
                this.ObjectResultModule.Message    = "sucess";
                this.ObjectResultModule.Object     = res;
            }
            else
            {
                this.ObjectResultModule.Object     = "";
                this.ObjectResultModule.StatusCode = 400;
                this.ObjectResultModule.Message    = "error!";
            }
            #region 操作日志
            var CreateYaeherOperList = new YaeherOperList()
            {
                OperExplain = "CreateOrderEarlyWarning",
                OperContent = JsonHelper.ToJson(input),
                OperType    = "CreateOrderEarlyWarning",
                CreatedBy   = userid,
                CreatedOn   = DateTime.Now
            };
            var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList);

            #endregion

            return(this.ObjectResultModule);
        }
示例#2
0
        public async Task <ObjectResultModule> UpdateOrderEarlyWarning([FromBody] OrderEarlyWarning input)
        {
            if (!Commons.CheckSecret(input.Secret))
            {
                this.ObjectResultModule.StatusCode = 422;
                this.ObjectResultModule.Message    = "Wrong Secret";
                this.ObjectResultModule.Object     = "";
                return(this.ObjectResultModule);
            }
            var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0;
            var query  = await _OrderEarlyWarningService.OrderEarlyWarningByID(input.Id);

            if (query != null)
            {
                query.ConsultNumber     = input.ConsultNumber;
                query.ConsultID         = input.ConsultID;
                query.OrderID           = input.OrderID;
                query.OrderNumber       = input.OrderNumber;
                query.ConsultantID      = input.ConsultantID;
                query.ConsultantName    = input.ConsultantName;
                query.PatientID         = input.PatientID;
                query.PatientName       = input.PatientName;
                query.DoctorID          = input.DoctorID;
                query.DoctorName        = input.DoctorName;
                query.RemindState       = input.RemindState;
                query.RemindDescription = input.RemindDescription;
                query.ModifyOn          = DateTime.Now;
                query.ModifyBy          = userid;
                var res = await _OrderEarlyWarningService.UpdateOrderEarlyWarning(query);

                this.ObjectResultModule.Object     = res;
                this.ObjectResultModule.Message    = "sucess";
                this.ObjectResultModule.StatusCode = 200;
            }
            else
            {
                this.ObjectResultModule.Message    = "NotFound";
                this.ObjectResultModule.StatusCode = 404;
                this.ObjectResultModule.Object     = "";
            }
            #region 操作日志
            var CreateYaeherOperList = new YaeherOperList()
            {
                OperExplain = "UpdateOrderEarlyWarning",
                OperContent = JsonHelper.ToJson(input),
                OperType    = "UpdateOrderEarlyWarning",
                CreatedBy   = userid,
                CreatedOn   = DateTime.Now
            };
            var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList);

            #endregion

            return(this.ObjectResultModule);
        }
示例#3
0
        public async Task <ObjectResultModule> DeleteOrderEarlyWarning([FromBody] OrderEarlyWarning input)
        {
            if (!Commons.CheckSecret(input.Secret))
            {
                this.ObjectResultModule.StatusCode = 422;
                this.ObjectResultModule.Message    = "Wrong Secret";
                this.ObjectResultModule.Object     = "";
                return(this.ObjectResultModule);
            }
            var userid = _IabpSession.UserId > 0 ? (int)_IabpSession.UserId : 0;
            var query  = await _OrderEarlyWarningService.OrderEarlyWarningByID(input.Id);

            if (query != null)
            {
                query.DeleteBy   = userid;
                query.DeleteTime = DateTime.Now;
                query.IsDelete   = true;
                var res = await _OrderEarlyWarningService.DeleteOrderEarlyWarning(query);

                this.ObjectResultModule.Object     = res;
                this.ObjectResultModule.Message    = "sucess";
                this.ObjectResultModule.StatusCode = 200;
            }
            else
            {
                this.ObjectResultModule.Message    = "NotFound";
                this.ObjectResultModule.StatusCode = 404;
                this.ObjectResultModule.Object     = "";
            }
            #region 操作日志
            var CreateYaeherOperList = new YaeherOperList()
            {
                OperExplain = "DeleteOrderEarlyWarning",
                OperContent = JsonHelper.ToJson(input),
                OperType    = "DeleteOrderEarlyWarning",
                CreatedBy   = userid,
                CreatedOn   = DateTime.Now
            };
            var resultLog = await _yaeherOperListService.CreateYaeherOperList(CreateYaeherOperList);

            #endregion

            return(this.ObjectResultModule);
        }
 public async Task <OrderEarlyWarning> UpdateOrderEarlyWarning(OrderEarlyWarning OrderEarlyWarningInfo)
 {
     return(await _repository.UpdateAsync(OrderEarlyWarningInfo));
 }
        public async Task <OrderEarlyWarning> CreateOrderEarlyWarning(OrderEarlyWarning OrderEarlyWarningInfo)
        {
            OrderEarlyWarningInfo.Id = await _repository.InsertAndGetIdAsync(OrderEarlyWarningInfo);

            return(OrderEarlyWarningInfo);
        }