public JsonResult AjaxLogin(string inputPhone, string inputPassword) { SimpleJsonResult result = new SimpleJsonResult(); var accountElement = LoginHelper.IsExistMobile(inputPhone.Trim()); if (accountElement == null) { result.message = "不存在的用户"; return(Json(result)); } string sha1Psd = StrExt.GetSHA1Str(inputPassword.Trim()); if (string.Compare(accountElement.Attribute("password").Value, sha1Psd, true) > 0) { result.message = "密码错误"; return(Json(result)); } LoginUser user = new LoginUser(); user.Mobile = inputPhone.Trim(); user.Password = sha1Psd; LoginHelper.AddLoginUserCookies(CookieName.loginUserCookieName, JsonConverter.SerializeObject(user)); result.status = 1; return(Json(result)); }
public JsonResult AjaxValidPropagandaUser(int userId, int state) { SimpleJsonResult jr = new SimpleJsonResult(); if (_propagandaUserService.ChangeUserState(userId, state) > 0) { jr.status = 1; } return(Json(jr)); }
public JsonResult DeletePropagandaAreaById(string ids) { SimpleJsonResult r = new SimpleJsonResult(); if (_propagandaUserService.DeletePropagandaArea(ids.TrimEnd(',')) > 0) { r.status = 1; } return(Json(r)); }
public JsonResult AjaxEditPropagandaArea(Propaganda_Area model) { SimpleJsonResult r = new SimpleJsonResult(); if ((model.Id > 0 && _propagandaUserService.UpdatePropagandaArea(model) > 0) || (model.Id <= 0 && _propagandaUserService.AddPropagandaArea(model) > 0)) { r.status = 1; } return(Json(r)); }
public ActionResult AjaxEditPropagandaUser(Propaganda_User model) { SimpleJsonResult r = new SimpleJsonResult(); if (_propagandaUserService.UpdatePropagandaUser(model)) { return(RedirectToAction("PropagandaUser")); } return(Redirect("EditePropagandaUser?id=" + model.Id)); }
public JsonResult AjaxDeletePropogandaUser(string ids) { SimpleJsonResult jr = new SimpleJsonResult(); if (_propagandaUserService.DeletePorpagandaUserById(ids.TrimEnd(',')) > 0) { jr.status = 1; } return(Json(jr)); }
public JsonResult AjaxGetPropagandaArea() { SimpleJsonResult jr = new SimpleJsonResult(); var list = _propagandaUserService.GetArea(); if (list != null && list.Count() > 0) { jr.status = 1; jr.data = list; } return(Json(jr)); }
public ActionResult RemoveYoneticiFromSpecificServer(long Id, string Ad) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add(Application.Resources.Control.MessageRemoveManager); _yoneticiServerService.RemoveYoneticiFromSpecificServer(Id, Ad); return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateYoneticiFromPopUp(long Id, string Ad, string EMail) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add(Application.Resources.Control.MessageUpdateManager); _service.UpdateYonetici(Id, Ad, EMail); return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); }
public string AjaxGetPropagandaUser(int aid, string keyword, int pageIndex, int pageSize) { SimpleJsonResult jr = new SimpleJsonResult(); int count = 0; var list = _propagandaUserService.GetUserByAreaId(out count, aid, keyword, pageIndex, pageSize); if (list != null && list.Count() > 0) { jr.status = 1; jr.data = list; jr.dataCount = count; } return(JsonConverter.SerializeObject(jr)); }
//Mesaj gönderimini iptal etmek için public ActionResult UpdatePing(long Id) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add(Application.Resources.Control.UpdatePing); _service.UpdatePing(Id); return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); }
public ActionResult IliskiEkle(string serverIp, string parentIp) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; long serverID = _service.GetServerIDFromIP(serverIp); long parentID = _service.GetServerIDFromIP(parentIp); if ((serverID != 0) && (parentID != 0) && (serverID != parentID)) { if (_linkedService.IliskiDbdeVarMi(serverID, parentID)) { sJRS.WarningMessages = new List <string>(); sJRS.WarningMessages.Add("İlişki zaten veritabanında kayıtlıdır."); sJRS.Statu = "fail"; } else { sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add(Application.Resources.Control.AddRelationServer); _linkedService.IliskiEkle(serverID, parentID); } } else if (serverID == 0 || parentID == 0) { sJRS.WarningMessages = new List <string>(); sJRS.WarningMessages.Add("Değerler veritabanında bulunamadı. Lütfen değerlerinizi tekrar kontrol ediniz."); sJRS.Statu = "fail"; } else if (serverID == parentID) { sJRS.WarningMessages = new List <string>(); sJRS.WarningMessages.Add("Aynı değerler arasında ilişki bulunamaz.."); sJRS.Statu = "fail"; } else { sJRS.WarningMessages = new List <string>(); sJRS.WarningMessages.Add("Belirtilen ilişkiler eklenemedi. Lütfen değerlerinizi tekrar kontrol ediniz."); sJRS.Statu = "fail"; } return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); }
public ActionResult IliskiSil(string serverIp, string parentIp) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; long serverID = _service.GetServerIDFromIP(serverIp); long parentID = _service.GetServerIDFromIP(parentIp); if ((serverID != 0) && (parentID != 0) && (serverID != parentID)) { if (_linkedService.IliskiDbdeVarMi(serverID, parentID)) { sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add("Silme işlemi başarılı bir şekilde yapılmıştır.."); _linkedService.IliskiSil(serverID, parentID); } else { sJRS.WarningMessages = new List <string>(); sJRS.WarningMessages.Add("Bu ilişki veritabanında bulunmamaktadır.."); sJRS.Statu = "fail"; } } else if (serverID == 0 || parentID == 0) { sJRS.WarningMessages = new List <string>(); sJRS.WarningMessages.Add("Değerler veritabanında bulunamadı. Lütfen değerlerinizi tekrar kontrol ediniz."); sJRS.Statu = "fail"; } else if (serverID == parentID) { sJRS.WarningMessages = new List <string>(); sJRS.WarningMessages.Add("Aynı değerler arasında ilişki bulunamaz.."); sJRS.Statu = "fail"; } else { sJRS.WarningMessages = new List <string>(); sJRS.WarningMessages.Add("Silme işlemi gerçekleştirilemedi.. Lütfen değerlerini kontrol ederek tekrar deneyiniz.."); sJRS.Statu = "fail"; } return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); }
public ActionResult DeleteServer(long Id) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add(Application.Resources.Control.MessageDeleteServer); _yoneticiServerService.DeleteServerConnection(Id); //delete servers connection with Yonetici table _linkedService.DeleteServerConnection(Id); //delete servers connection with SERVER_ILISKILI_SUNUCU table _appService.DeleteServerApp(Id); //delete servers connection with SERVER_UYGULAMALAR table _service.DeleteServer(Id); //delete server from database return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); }
public ActionResult AddServer(string lokasyon, string serverTipi, string operatingSystem, string serverIp, string computerName, string aciklama) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add(Application.Resources.Control.MessageCreateServer); List <string> IPList = _service.GetServerIPs(); foreach (var item in IPList) { if (item == serverIp) { return(null); } } var lokasyonId = _lokasyonAppService.GetLocationId(lokasyon); var serverTipiId = _serverTipiAppService.GetServerTypeId(serverTipi); var operatingSystemId = _operatingSystemAppService.GetOperatingSystemId(operatingSystem); string Session_EMail = Session["EMail"].ToString(); try { _service.AddServer(lokasyonId, serverTipiId, operatingSystemId, serverIp, computerName, aciklama, Session_EMail); } catch (Exception e) { e.ToString(); } return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); }
public ActionResult AddYoneticiToSpecificServer(long _Id, string _Ad) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add(Application.Resources.Control.MessageAddManager); AvServer _server = _serverService.GetServer(_Id); AvYonetici _yonetici = _service.GetYonetici(_Ad); bool eklendi = _yoneticiServerService.AddManagerToSpecificServer(_server, _yonetici); if (!eklendi) { sJRS.Statu = Application.Enumerations.ServiceManagement.jsonResultFailLabel; sJRS.SuccessMessages.Remove(Application.Resources.Control.MessageAddManager); sJRS.SuccessMessages.Add(Application.Resources.Control.MessageCouldNotAddManager); } return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); }
public ActionResult CreateYonetici(string Ad, string EMail) { SimpleJsonResult sJRS = new SimpleJsonResult() { Statu = Application.Enumerations.ServiceManagement.jsonResultSuccessLabel }; sJRS.SuccessMessages = new List <string>(); sJRS.SuccessMessages.Add(Application.Resources.Control.MessageCreateManager); bool isExistSorumlu = false; List <AvYonetici> YoneticiList = new List <AvYonetici>(); YoneticiList = _service.GetAllYonetici(); AvYonetici updated = null; for (int i = 0; i < YoneticiList.Count; i++) { if (Ad == YoneticiList[i].Ad || EMail == YoneticiList[i].EMail) { updated = YoneticiList[i]; isExistSorumlu = true; break; } } if (isExistSorumlu == true) { _service.UpdateYonetici(updated.Id, Ad, EMail); return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); } else { _service.CreateYonetici(Ad, EMail); return(Json(JsonConvert.SerializeObject(sJRS), JsonRequestBehavior.AllowGet)); } }