public Task SendBillToAdmin(int idBill) { DaoManageBill daoBill = new DaoManageBill(); BillViewModel model = new BillViewModel(); var donHang = daoBill.GetById(idBill); BillViewModel billViewModel = new BillViewModel(); billViewModel.CustomerName = donHang.Customer.Name; billViewModel.Status = donHang.Status; billViewModel.ProductName = donHang.SanPham.Name; billViewModel.Descript = donHang.Note; billViewModel.Price = (double)donHang.Price; billViewModel.OrderDate = donHang.Insert_YMD; billViewModel.Address = donHang.Customer.Address; billViewModel.NumberPhone = donHang.Customer.Number; billViewModel.Id = donHang.Id; billViewModel.IdProduct = donHang.Id_product; return(Clients.Group(Pittmark.Common.Constraints.Admin).getBill(billViewModel)); }
public HttpResponseMessage Get(HttpRequestMessage request, int id) { try { var donHang = _daoManageBill.GetById(id); BillViewModel billViewModel = new BillViewModel(); billViewModel.CustomerName = donHang.Customer.Name; billViewModel.Status = donHang.Status; billViewModel.ProductName = donHang.SanPham.Name; billViewModel.Descript = donHang.Note; billViewModel.Price = (double)donHang.Price; billViewModel.OrderDate = donHang.Insert_YMD; billViewModel.Address = donHang.Customer.Address; billViewModel.NumberPhone = donHang.Customer.Number; billViewModel.Id = donHang.Id; billViewModel.IdProduct = donHang.Id_product; var result = request.CreateResponse(HttpStatusCode.OK, billViewModel); return(result); } catch { return(null); } }