public virtual void UpdateHistoryXeXuatBenTrangThai(int Id, int NguoiTaoId, ENTrangThaiXeXuatBen trangthai)
        {
            var item = GetHistoryXeXuatBenId(Id);

            item.TrangThai = trangthai;
            UpdateHistoryXeXuatBen(item);
            var _log = new HistoryXeXuatBenLog();

            _log.XeXuatBenId = item.Id;
            _log.TrangThai   = trangthai;
            _log.NguoiTaoId  = NguoiTaoId;
            switch (trangthai)
            {
            case ENTrangThaiXeXuatBen.DANG_DI:
            {
                _log.GhiChu = "Khởi hành";
                break;
            }

            case ENTrangThaiXeXuatBen.KET_THUC:
            {
                _log.GhiChu = "Về bến";
                break;
            }
            }
            InsertHistoryXeXuatBenLog(_log);
        }
 public virtual void DeleteHistoryXeXuatBenLog(HistoryXeXuatBenLog _item)
 {
     if (_item == null)
     {
         throw new ArgumentNullException("NhaXe");
     }
     _historyxexuatbenlogRepository.Delete(_item);
 }
 public virtual void InsertHistoryXeXuatBenLog(HistoryXeXuatBenLog _item)
 {
     if (_item == null)
     {
         throw new ArgumentNullException("NhaXe");
     }
     _item.NgayTao = DateTime.Now;
     _historyxexuatbenlogRepository.Insert(_item);
 }
Exemple #4
0
        HistoryXeXuatBenLog CreateHistoryXeXuatBenLog(ENTrangThaiXeXuatBen trangthai, String ghichu, int XeXuatBenId, int NguoiTaoId)
        {
            var item = new HistoryXeXuatBenLog();

            item.TrangThai   = trangthai;
            item.GhiChu      = ghichu;
            item.XeXuatBenId = XeXuatBenId;
            item.NguoiTaoId  = NguoiTaoId;
            _nhaxeService.InsertHistoryXeXuatBenLog(item);
            return(item);
        }
        public virtual void InsertHistoryXeXuatBen(HistoryXeXuatBen _item)
        {
            if (_item == null)
            {
                throw new ArgumentNullException("NhaXe");
            }

            _historyxexuatbenRepository.Insert(_item);
            var _log = new HistoryXeXuatBenLog();

            _log.XeXuatBenId = _item.Id;
            _log.TrangThai   = _item.TrangThai;
            _log.GhiChu      = "Thiết đặt xe xuất bến";
            _log.NguoiTaoId  = _item.NguoiTaoId;
            InsertHistoryXeXuatBenLog(_log);
        }