示例#1
0
        public JsonResult DanhSachNXB()
        {
            Request.ContentEncoding  = Encoding.UTF8;
            Response.ContentEncoding = Encoding.UTF8;
            var dsNXB   = nxbService.GetAll();
            var listNXB = new List <object>();

            foreach (var nxb in dsNXB)
            {
                listNXB.Add(new
                {
                    label = nxb.TenNXB,
                    value = nxb.Id
                });
            }

            return(Json(listNXB, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult CongNoNXB(DateTime NgayThongKe)
        {
            var listNXB   = nxbService.GetAll();
            var listNXBVm = Mapper.Map <IEnumerable <NhaXuatBan>, IEnumerable <NhaXuatBanViewModel> >(listNXB);

            listNXBVm.ToList().ForEach(x =>
            {
                var congNoNXB   = congNoNXBService.GetSingleByIdAndDate(x.Id, NgayThongKe);
                var congNoNXBVm = Mapper.Map <CongNoNXB, CongNoNXBViewModel>(congNoNXB);
                if (congNoNXBVm != null)
                {
                    x.CongNoNXB = congNoNXBVm;
                }
                else
                {
                    x.CongNoNXB = new CongNoNXBViewModel();
                }
            });
            return(View(listNXBVm));
        }