public ActionResult SyncData() { StringBuilder s = new StringBuilder(); if (ClsData.btnSync == "") { ClsData.btnSync = Conn.getInfo("select HoTen from NhanVien where MaNV=" + int.Parse(CookieCls.GetMaNV()) + ""); if (ClsData.listRequest.Count > 0) { string insertdata = ""; for (int i = 0; i < ClsData.listRequest.Count; i++) { insertdata += "insert into rssNews(rssID,NewspaperMenuId,Title,IconRss,IconSave,Link,[Description],Summary,rssDate,DateInput,Effect,MaNV) values(" + string.Join(",", ClsData.listRequest[i]) + "," + CookieCls.GetMaNV() + ")"; } Conn.InsertBatch(insertdata); } ClsData.ClearArray(); db.mProcesses.RemoveRange(db.mProcesses); db.SaveChanges(); //Conn.UpdateRowData("delete from mProcess"); } return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); }
public ActionResult ResetData() { StringBuilder s = new StringBuilder(); ClsData.ClearArray(); //Conn.UpdateRowData("delete from mProcess"); db.mProcesses.RemoveRange(db.mProcesses); db.SaveChanges(); int async = ClsData.countRequest - (ClsData.countRequestSuccess + ClsData.countRequestFail + ClsData.countRequestDup); s.Append("<strong id='msgArray' style='color: white; font-weight: bold; font-size: 20px'>" + ClsData.countRequestSuccess + " (R=" + ClsData.countRequest + " S=" + ClsData.countRequestSuccess + " D=" + ClsData.countRequestDup + " F=" + ClsData.countRequestFail + " <strong style='color:Red'>W=" + async + "</strong>)</strong>"); string shtml = "" + s; return(Json(new { success = true, async, shtml }, JsonRequestBehavior.AllowGet)); }