// // GET: /Liangbiao/Details/5 public ActionResult List(int?p, int id) { Pager pager = new Pager(); pager.table = "CMSTizhi"; pager.strwhere = "TizhiCustomerId=" + id; pager.PageSize = 10; pager.PageNo = p ?? 1; pager.FieldKey = "TizhiId"; pager.FiledOrder = "TizhiId Desc"; pager = CMSService.SelectAll("Tizhi", pager); List <TizhiDto> list = new List <TizhiDto>(); foreach (DataRow dr in pager.EntityDataTable.Rows) { TizhiDto dto = TizhiMapping.getDTO(dr); list.Add(dto); } pager.Entity = list.AsQueryable(); ViewBag.PageNo = p ?? 1; ViewBag.PageCount = pager.PageCount; ViewBag.RecordCount = pager.Amount; ViewBag.Message = pager.Amount; ViewBag.CustomerId = id; ViewBag.CustomerName = MyService.CustomerIdToName("CustomerId=" + id); return(View(pager.Entity)); }
public ActionResult Details(int id) { TizhiDto dto = new TizhiDto(); DataTable dt = CMSService.SelectOne("Tizhi", "CMSTizhi", "TizhiId=" + id); foreach (DataRow dr in dt.Rows) { dto = TizhiMapping.getDTO(dr); } CustomerDto cDto = new CustomerDto(); DataTable CustomerDt = CMSService.SelectOne("Customer", "CMSCustomer", "CustomerId=" + dto.TizhiCustomerId); foreach (DataRow cdr in CustomerDt.Rows) { cDto = CustomerMapping.getDTO(cdr); } ViewBag.CustomerName = cDto.CustomerName; ViewBag.CustomerSex = cDto.CustomerSex; ViewBag.CustomerBirthday = cDto.CustomerBirthday.ToShortDateString(); return(View(dto)); }