// // GET: /Yuyue/ public ActionResult Index(int?p, int?id) { Pager pager = new Pager(); pager.table = "CMSYuyue"; pager.strwhere = "1=1"; if (id != 0) { pager.strwhere = pager.strwhere + "YuyueDoctorId=" + id; } // pager.strwhere = "YuyueCustomerId=" + id; pager.PageSize = 10; pager.PageNo = p ?? 1; pager.FieldKey = "YuyueId"; pager.FiledOrder = "YuyueDateTime Desc"; pager = CMSService.SelectAll("Yuyue", pager); List <YuyueDto> list = new List <YuyueDto>(); foreach (DataRow dr in pager.EntityDataTable.Rows) { YuyueDto dto = YuyueMapping.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 List(int?p) { int DoctorId = int.Parse(System.Web.HttpContext.Current.Request.Cookies["UserId"].Value); Pager pager = new Pager(); pager.table = "CMSYuyue"; pager.strwhere = " YuyueDoctorId=" + DoctorId; pager.PageSize = 10; pager.PageNo = p ?? 1; pager.FieldKey = "YuyueId"; pager.FiledOrder = "YuyueDateTime Desc"; pager = CMSService.SelectAll("Yuyue", pager); List <YuyueDto> list = new List <YuyueDto>(); foreach (DataRow dr in pager.EntityDataTable.Rows) { YuyueDto dto = YuyueMapping.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; return(View(pager.Entity)); }
public static IMapping CreatMapping(string DtoName) { IMapping Mapping = null; if (DtoName == "User") { Mapping = new UserMapping(); } if (DtoName == "Role") { Mapping = new RoleMapping(); } if (DtoName == "Category") { Mapping = new CategoryMapping(); } if (DtoName == "Article") { Mapping = new ArticleMapping(); } if (DtoName == "Image") { Mapping = new ImageMapping(); } if (DtoName == "Customer") { Mapping = new CustomerMapping(); } if (DtoName == "Tizhi") { Mapping = new TizhiMapping(); } if (DtoName == "Xueya") { Mapping = new XueyaMapping(); } if (DtoName == "Jianyan") { Mapping = new JianyanMapping(); } if (DtoName == "Chufang") { Mapping = new ChufangMapping(); } if (DtoName == "Jixiao") { Mapping = new JixiaoMapping(); } if (DtoName == "Fankui") { Mapping = new FankuiMapping(); } if (DtoName == "Yuyue") { Mapping = new YuyueMapping(); } return(Mapping); }
public ActionResult ListByDay(int?p, int?theday) { int DoctorId = int.Parse(System.Web.HttpContext.Current.Request.Cookies["UserId"].Value); Pager pager = new Pager(); pager.table = "CMSYuyue"; DateTime today = System.DateTime.Now.Date; DateTime yesterday = today.AddDays(-1); DateTime tomorrow = today.AddDays(1); if (theday == 0) { ViewBag.Title = "今日预约"; pager.strwhere = " YuyueDoctorId=" + DoctorId + " and " + "datediff(day,'" + today + "',YuyueDateTime) =0"; } if (theday == 1) { ViewBag.Title = "昨日预约"; pager.strwhere = " YuyueDoctorId=" + DoctorId + " and " + "datediff(day,'" + yesterday + "',YuyueDateTime) =0"; } if (theday == 2) { ViewBag.Title = "明日预约"; pager.strwhere = " YuyueDoctorId=" + DoctorId + " and " + "datediff(day,'" + tomorrow + "',YuyueDateTime) =0"; } if (theday == 3) { ViewBag.Title = "全部待诊预约"; pager.strwhere = " YuyueDoctorId=" + DoctorId + " and " + "datediff(day,'" + yesterday + "',YuyueDateTime) >0"; } // pager.strwhere = " YuyueDoctorId=" + DoctorId; pager.PageSize = 10; pager.PageNo = p ?? 1; pager.FieldKey = "YuyueId"; pager.FiledOrder = "YuyueDateTime Desc"; pager = CMSService.SelectAll("Yuyue", pager); List <YuyueDto> list = new List <YuyueDto>(); foreach (DataRow dr in pager.EntityDataTable.Rows) { YuyueDto dto = YuyueMapping.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; return(View(pager.Entity)); }