Ejemplo n.º 1
0
        public async Task <bool> AcceptReceive(string receiveID)
        {
            var receiveModel = await _repoReceive.GetAll().Where(x => x.ID.Trim() == receiveID.Trim()).FirstOrDefaultAsync();

            if (receiveModel != null)
            {
                receiveModel.Status       = "2";
                receiveModel.Updated_Time = DateTime.Now;
                return(await _repoReceive.SaveAll());
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public async Task <bool> AcceptReceive(string receiveID)
        {
            var receiveModel = _repoReceive.FindSingle(x => x.ID.Trim() == receiveID.Trim());

            if (receiveModel != null)
            {
                receiveModel.Status       = "2";
                receiveModel.Updated_Time = DateTime.Now;
                try {
                    return(await _repoReceive.SaveAll());
                } catch (Exception) {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        public async Task <bool> ReceiveRegister(Receive_Dto model)
        {
            model.ID            = this.RandomString();
            model.Register_Date = DateTime.Now;
            model.Updated_Time  = DateTime.Now;
            model.Status        = "0";
            var receive = _mapper.Map <Receive>(model);

            _repoReceive.Add(receive);
            return(await _repoReceive.SaveAll());
        }