public void RefreshDonHang() { DonHangNhanList.Clear(); foreach (var donHang in DonHangBUS.SelectDonHangByTrangThai(TrangThai.DaXacNhan.ToString())) { DonHangNhanList.Add(new DonHangGiaoNhan(donHang)); } }
public void CompleteDonHang() { if (SelectedDonHangNhan == null) { return; } var dialog = IoC.Get <DialogViewModel>(); dialog.Question = "Hoàn tất nhận đơn hàng đã chọn?"; dialog.DisplayName = ""; var result = _windowManager.ShowDialog(dialog); if (result != true) { return; } SelectedDonHangNhan.TenTrangThai = TrangThai.DaNhanHang; var donHang = SelectedDonHangNhan; var tmp = new DonHangDTO { MaDonHang = donHang.MaDonHang, LienHeNguoiBan = donHang.LienHeNguoiBan, DiaDiemGiao = donHang.DiaDiemGiaoHang, DiaDiemNhan = donHang.DiaDiemNhanHang, GhiChu = donHang.GhiChu, KhuVuc = donHang.TenKhuVuc.ToString(), LoaiDonHang = donHang.TenLoaiDonHang.ToString(), MaNhanVienGiao = donHang.MaNhanVienGiao, MaNhanVienNhan = donHang.MaNhanVienNhan, NgayDatHang = donHang.NgayDatHang, TenNguoiMua = donHang.TenNguoiMua, TenNguoiBan = donHang.TenNguoiBan, TienThuHo = donHang.TienThuHo, TrangThai = donHang.TenTrangThai.ToString(), SDTNguoiBan = donHang.SdtNguoiBan, SDTNguoiMua = donHang.SdtNguoiMua, TongThanhTien = donHang.TongThanhTien, NgayGiaoHang = donHang.NgayGiaoHang, NgayNhanHang = donHang.NgayNhanHang, PhiVanChuyen = donHang.PhiVanChuyen, PhiPhatSinh = donHang.PhiPhatSinh }; try { DonHangBUS.SuaDonHang(tmp); DonHangNhanList.Remove(SelectedDonHangNhan); } catch (Exception e) { var error = IoC.Get <ErrorViewModel>(); error.ErrorName = e.Message; error.DisplayName = "Lỗi"; _windowManager.ShowDialog(error); } }