public ActionResult Index(string stock) { #region test Blance //IRepository<MAccDetailLog> refda = new MAccDetailLogRepository(); //var vjkdaf = refda.GetAll(); #endregion IRightExecRepository<RightExec> rpo = new RightExecRepository(); IEnumerable<RightExec> paging = new List<RightExec>(); ViewBag.Message = "Cập nhật quyền"; if (stock == null) ViewData["stockcode"] = string.Empty; else { Session["Stockcode"] = stock; if(listRightExec ==null) listRightExec = rpo.getRightExecListFromStock(Session["Stockcode"].ToString()); ViewData["count"] = listRightExec.Count; paging = listRightExec.Skip((1 - 1) * pageSize).Take(pageSize);//paging ViewData["pageNo"] = 1; ViewData["stockcode"] = stock; // luu lai gia tri sau khi tim } //IRepository<Post> repo = new PostRepository(); return View(paging); }
public ActionResult Paging(string page) { if (Session["Stockcode"] == null) { return RedirectToAction("Index"); } ViewBag.Message = "Cập nhật quyền"; IRightExecRepository<RightExec> rpo = new RightExecRepository(); IEnumerable<RightExec> testpaging = new List<RightExec>(); if (listRightExec == null) listRightExec = rpo.getRightExecListFromStock(Session["Stockcode"].ToString()); ViewData["count"] = listRightExec.Count; ViewData["pageNo"] = page; testpaging = listRightExec.Skip((Convert.ToInt32(page) - 1) * pageSize).Take(pageSize);//paging return View("Index",testpaging); }
protected override void OnStart(string[] args) { int intervalMinutes = Convert.ToInt32(ConfigurationManager.AppSettings["IntervalMinutes"].ToString()); string FileOutPut = ConfigurationManager.AppSettings["FileOutPut"].ToString(); ////string userName = ConfigurationManager.AppSettings["SmsUserName"]; ////string password = ConfigurationManager.AppSettings["SmsPassword"]; while (true) { try { //SendSMS sendSMS = new SendSMS(userName, password); //result = sendSMS.Send("0909070481", "test gui tin nhan sinh nhat"); #region test output IRightExecRepository<RightExec> rpo = new RightExecRepository(); IList<RightExec> listRightExec = rpo.getRightExecListFromStock("KLS"); //TextWriter tw = new StreamWriter(FileOutPut); //tw.WriteLine(result == 1 ? "Gui thanh cong" : "gui khong thanh cong" + "\n"); //tw.Close(); Ultility.LogFile("----- Begin Sending SMS -----", FileOutPut); //Ultility.Info(DateTime.Now.ToLongTimeString()); #endregion Thread.Sleep(intervalMinutes * 1000 * 30); // start continue after intervalMinutes } catch (Exception ex) { } } }