public static WebNoticeViewModel GetWebNoticebyId(int Id) { WebNoticeViewModel model = new WebNoticeViewModel(); List <WebNoticeViewModel> wnList = XMLWebNoticeReaderWriter.ReadWebNoticeData(); model = wnList.Where(x => x.NoticeId == Id).FirstOrDefault(); return(model); }
public ActionResult WebNotice(int?page) { IList <WebNoticeViewModel> wnList = XMLWebNoticeReaderWriter.ReadWebNoticeData(); int pageSize = 25; int pageNumber = (page ?? 1); return(View(wnList.ToPagedList(pageNumber, pageSize))); //return View(wnList.ToList()); }
public ActionResult Index(int?page) { List <WebNoticeViewModel> wnList = XMLWebNoticeReaderWriter.ReadWebNoticeData(); int pageSize = 10; int pageNumber = (page ?? 1); wnList = wnList.OrderByDescending(x => x.NoticeId).ToList(); return(View(wnList.ToPagedList(pageNumber, pageSize))); }
public ActionResult Edit(WebNoticeViewModel model) { try { model.UpdatedDate = DateTime.Now; bool result = XMLWebNoticeReaderWriter.UpdateWebNotice(model); if (result) { return(RedirectToAction("Index")); } else { return(View(model)); } } catch { } return(View()); }
public ActionResult Edit(int id) { WebNoticeViewModel model = XMLWebNoticeReaderWriter.GetWebNoticeDetails(id); return(View(model)); }
public static bool DeleteWebNotice(WebNoticeViewModel model) { return(XMLWebNoticeReaderWriter.DeleteWebNotice(model)); }
public static bool ApendWebNotice(WebNoticeViewModel model) { return(XMLWebNoticeReaderWriter.AddWebNotice(model)); }
public static List <WebNoticeViewModel> GetAllWebNoticeList() { List <WebNoticeViewModel> wnList = XMLWebNoticeReaderWriter.ReadWebNoticeData(); return(wnList); }