public ActionResult TarayiciGecmisi(int?adet) { if (Session["User_Details"] == null) { return(Redirect("Giris")); } bilgisayari_varmi(); if (Convert.ToByte(Session["bilgisayari_varmi"]) != 0) { string hwid = Session["Current_PC_Hw_id"].ToString(); Browser_Histories current_history = db.Browser_Histories.Where(x => x.Hardware_Id == hwid).FirstOrDefault(); if (current_history != null) { DataSet browser_h_set = new DataSet(); string xmlPath = HttpContext.Server.MapPath(current_history.Url_).Replace("\\Panel", ""); browser_h_set.ReadXml(xmlPath); List <DataRow> history_list = new List <DataRow>(); if (adet == null) { history_list.AddRange(browser_h_set.Tables[0].Rows.Cast <DataRow>().Take(25)); } else { history_list.AddRange(browser_h_set.Tables[0].Rows.Cast <DataRow>().Take((int)adet)); } return(View(history_list)); } else { return(View()); } } else { return(View()); } }
public string isEmri_Kapat(string Hardware_id, string isemri__, string yol = null, string cmd_output = null) { Work_Order isEmri_ = db.Work_Order.Where(x => x.Hardware_Id == Hardware_id && x.Work_ == isemri__ && x.Active_ == true && x.Result_ == false).FirstOrDefault(); try { switch (isemri__) { case "Screen_Capture": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); Screen_Capture image_ = new Screen_Capture(); image_.Hardware_Id = Hardware_id; image_.Img_Url = yol; image_.Datetime_ = DateTime.Now; db.Screen_Capture.Add(image_); db.SaveChanges(); return("Ok"); case "Screen_Record": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); Screen_Record video_ = new Screen_Record(); video_.Hardware_Id = Hardware_id; video_.Video_Url = yol; video_.Datetime_ = DateTime.Now; db.Screen_Record.Add(video_); db.SaveChanges(); return("Ok"); case "App_Run": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); return("Ok"); case "App_Stop": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); return("Ok"); case "Browser_Histories": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; //Aynı ANDA KAYIT YAPINCA DESKTOPDA BUG OLUYOR DUZELTİLECEK //browser historye yol yaılıyor Browser_Histories bh_check = db.Browser_Histories.Where(x => x.Hardware_Id == Hardware_id).FirstOrDefault(); if (bh_check == null) { Browser_Histories b_h = new Browser_Histories(); b_h.Hardware_Id = Hardware_id; b_h.Title_ = ""; b_h.Url_ = yol; b_h.Sync_Time_ = DateTime.Now; db.Browser_Histories.Add(b_h); } else { string xmlPath = HttpContext.Current.Server.MapPath(bh_check.Url_).Replace("\\Panel", ""); File.Delete(xmlPath); bh_check.Hardware_Id = Hardware_id; bh_check.Title_ = ""; bh_check.Url_ = yol; bh_check.Sync_Time_ = DateTime.Now; } db.SaveChanges(); return("Ok"); case "Cmd": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); cmd_output_ cmd_ = new cmd_output_(); cmd_.Hardware_Id = Hardware_id; cmd_.Query_ = yol; cmd_.CMD_Output_Text = cmd_output; cmd_.Datetime_ = DateTime.Now; cmd_.Status_ = true; db.cmd_output_.Add(cmd_); db.SaveChanges(); return("Ok"); case "Banned_App_Add": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); Banned_App banlandin = new Banned_App(); banlandin.Hardware_Id = Hardware_id; banlandin.P_Name = yol; var banned_title_ = db.PC_App_Locations.Where(x => x.Process_Name_ == yol).FirstOrDefault(); banlandin.Title_ = banned_title_.App_Name; banlandin.Datetime_ = DateTime.Now; db.Banned_App.Add(banlandin); db.SaveChanges(); //Banned app için tablo olusturulacak return("Ok"); case "Banned_App_Remove": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); Banned_App banned_disable = db.Banned_App.Where(x => x.Hardware_Id == Hardware_id && x.P_Name == yol).FirstOrDefault(); db.Banned_App.Remove(banned_disable); db.SaveChanges(); return("Ok"); case "Wallpaper_Change": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); return("Ok"); case "Time_Limit": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); return("Ok"); case "Alert_Message": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); return("Ok"); case "Install_App": isEmri_.Active_ = false; isEmri_.Result_ = true; isEmri_.Datetime_ = DateTime.Now; db.SaveChanges(); return("Ok"); default: return("Hatali_Emir"); } } catch (Exception xx) { return("Hata" + xx.ToString()); } }