public ActionResult TongGiaTriTheoTrangThaiDonHang(string StartTime, string EndTime) { DateTime _tungay = DateTime.Now; if (!string.IsNullOrEmpty(StartTime) || !string.IsNullOrWhiteSpace(StartTime)) { _tungay = TypeHelper.ToDate(StartTime); } DateTime _denngay = DateTime.Now; if (!string.IsNullOrEmpty(EndTime) || !string.IsNullOrWhiteSpace(EndTime)) { _denngay = TypeHelper.ToDate(EndTime); } shOrderService _order = new shOrderService(); IEnumerable <shOrder> dsDonHang = _order.DanhSachOrder_TheoThoiGian(_tungay, _denngay); List <BieuDoDonHang> ds = new List <BieuDoDonHang>(); BieuDoDonHang donhang = new BieuDoDonHang(); // 1. Đang xử lý IEnumerable <shOrder> dsTheoTrangThai = _order.DanhSachOrder_ByStatus( dsDonHang, null, OrderStatus.DangXuLy.GetHashCode()); ds.Add(VeBieuDoKinhDoanh(dsTheoTrangThai, "Đang xử lý")); // 2 . Đang giao hàng dsTheoTrangThai = _order.DanhSachOrder_ByStatus( dsDonHang, null, OrderStatus.DangGiaoHang.GetHashCode()); ds.Add(VeBieuDoKinhDoanh(dsTheoTrangThai, "Đang giao hàng")); // Đã giao hàng dsTheoTrangThai = _order.DanhSachOrder_ByStatus( dsDonHang, null, OrderStatus.DaGiaoHang_ChuaXacNhan.GetHashCode()); ds.Add(VeBieuDoKinhDoanh(dsTheoTrangThai, "Đã giao hàng")); // Đã Hủy dsTheoTrangThai = _order.DanhSachOrder_ByStatus( dsDonHang, null, OrderStatus.HuyDonHang.GetHashCode()); ds.Add(VeBieuDoKinhDoanh(dsTheoTrangThai, "Đã hủy")); if (Request.IsAjaxRequest()) { return(Json(ds, JsonRequestBehavior.AllowGet)); } return(PartialView("TongGiaTriTheoTrangThaiDonHang", dsDonHang)); }
public ActionResult ListOrders(int?Status) { if (!Status.HasValue) { Status = C.Core.Common.OrderStatus.DangXuLy.GetHashCode(); } shOrderService _order = new shOrderService(); IEnumerable <shOrder> dsOrder = _order.DanhSachOrder_ByStatus(User.Identity.GetMemberLogin().MemberGuid, Status); if (dsOrder == null) { dsOrder = new List <shOrder>(); } return(PartialView("ListOrders", dsOrder)); }
public static int FindPageOrder(string OrderGuid, int?OrderStatus, int PageSize, int UserId) { try { shOrderService _order = new shOrderService(); int index = _order.DanhSachOrder_ByStatus(null, OrderStatus, UserId).ToList().FindIndex(x => x.OrderGuid == OrderGuid); if (index > 0) { index = index / PageSize + 1; return(index); } } catch { return(1); } return(1); }