public ActionResult TaskSend(List <int> PanelList, CommandConstants OprKod, int AlarmID = -1) { if (permissionUser.SysAdmin == false) { if (permissionUser.Grup_Islemleri == 2 || permissionUser.Grup_Islemleri == 3) { throw new Exception("Bu işleme yetkiniz yok!"); } } if (AlarmID != -1) { try { foreach (var item in PanelList) { var panelModel = _panelSettingsService.GetById(item); if (panelModel.Panel_Model != (int)PanelModel.Panel_1010) { TaskList taskList = new TaskList { Deneme_Sayisi = 1, Durum_Kodu = (int)PanelStatusCode.Beklemede, Gorev_Kodu = (int)OprKod, Kullanici_Adi = user.Kullanici_Adi, IntParam_1 = AlarmID, Panel_No = item, Tablo_Guncelle = true, Tarih = DateTime.Now }; TaskList taskListReceive = _taskListService.AddTaskList(taskList); if (OprKod == CommandConstants.CMD_ERS_USERALARM) { _accessDatasService.AddOperatorLog(142, user.Kullanici_Adi, AlarmID, 0, item, 0); } else { _accessDatasService.AddOperatorLog(143, user.Kullanici_Adi, AlarmID, 0, item, 0); } } } Thread.Sleep(2000); } catch (Exception) { return(RedirectToAction("Index")); } } return(RedirectToAction("Index")); }
public ActionResult TaskSend(List <int> PanelList, CommandConstants OprKod, int AsansorGrupNo = -1) { if (permissionUser.SysAdmin == false) { if (permissionUser.Grup_Islemleri == (int)SecurityCode.Sadece_Izleme || permissionUser.Grup_Islemleri == (int)SecurityCode.Yetkisiz) { throw new Exception("Bu işlem için yetkiniz yok!"); } } if (AsansorGrupNo != -1) { try { foreach (var item in PanelList) { if (_panelSettingsService.GetPanelModelByPanelID(item) != (int)PanelModel.Panel_1010) { TaskList taskList = new TaskList { Deneme_Sayisi = 1, Durum_Kodu = (int)PanelStatusCode.Beklemede, Gorev_Kodu = (int)OprKod, IntParam_1 = AsansorGrupNo, Kullanici_Adi = user.Kullanici_Adi, Panel_No = item, Tablo_Guncelle = true, Tarih = DateTime.Now }; _taskListService.sp_AddTaskList(taskList); _accessDatasService.AddOperatorLog(163, user.Kullanici_Adi, AsansorGrupNo, 0, item, 0); } } } catch (Exception) { return(RedirectToAction("LiftGroups")); } } return(RedirectToAction("LiftGroups")); }
public CreateTicketCommand(ITravellerFactory travellerFactory, IDataStore dataStore, CommandConstants commandConstants) : base(travellerFactory, dataStore, commandConstants) { }
public void SetUp() { this.travelerFactoryMock = new Mock <ITravellerFactory>(); this.dataStoreMock = new Mock <IDataStore>(); commandConstants = new CommandConstants(); }
public ListJourneysCommand(IDataStore dataStore, CommandConstants commandConstants) : base(dataStore, commandConstants) { }
public ListTicketsCommand(IDataStore dataStore, CommandConstants commandConstants) : base(dataStore, commandConstants) { }
protected ListCommand(IDataStore dataStore, CommandConstants commandConstants) { this.DataStore = dataStore; CommandConstants = commandConstants; }
protected CreateVehicleCommand(ITravellerFactory travellerFactory, IDataStore dataStore, CommandConstants commandConstants) : base(travellerFactory, dataStore, commandConstants) { }
public void Send(List <int> PanelList, CommandConstants OprKod, int UserID = -1) { if (permissionUser.SysAdmin == false) { if (permissionUser.Grup_Islemleri == (int)SecurityCode.Sadece_Izleme || permissionUser.Grup_Islemleri == (int)SecurityCode.Yetkisiz) { throw new Exception("Bu işleme yetkiniz yok!"); } } if (UserID != -1) { try { if (OprKod == CommandConstants.CMD_SNDALL_USER) { foreach (var panel in PanelList) { TaskList taskListRemove = new TaskList { Deneme_Sayisi = 1, Durum_Kodu = (int)PanelStatusCode.Beklemede, Gorev_Kodu = (int)CommandConstants.CMD_ERSALL_USER, IntParam_1 = 1, Kullanici_Adi = user.Kullanici_Adi, Panel_No = panel, Tablo_Guncelle = true, Tarih = DateTime.Now }; _taskListService.sp_AddTaskList(taskListRemove); TaskList maxUser = new TaskList { Deneme_Sayisi = 1, Durum_Kodu = (int)PanelStatusCode.Beklemede, Gorev_Kodu = (int)CommandConstants.CMD_SND_MAXUSERID, IntParam_1 = _userService.GetAllUsers().Max(x => x.ID), Kullanici_Adi = user.Kullanici_Adi, Panel_No = panel, Tablo_Guncelle = true, Tarih = DateTime.Now }; _taskListService.sp_AddTaskList(maxUser); _reportService.SendAllUserTask(2620, DateTime.Now, 1, permissionUser.Kullanici_Adi, panel); //foreach (var userID in userListe) //{ // TaskList taskList = new TaskList // { // Deneme_Sayisi = 1, // Durum_Kodu = (int)PanelStatusCode.Beklemede, // Gorev_Kodu = (int)CommandConstants.CMD_SND_USER, // IntParam_1 = userID, // Kullanici_Adi = user.Kullanici_Adi, // Panel_No = panel, // Tablo_Guncelle = true, // Tarih = DateTime.Now // }; // _taskListService.sp_AddTaskList(taskList); // _accessDatasService.AddOperatorLog(103, permissionUser.Kullanici_Adi, userID, 0, 0, 0); //} } } else if (OprKod == CommandConstants.CMD_ERSALL_USER) { foreach (var item in PanelList) { TaskList taskList = new TaskList { Deneme_Sayisi = 1, Durum_Kodu = (int)PanelStatusCode.Beklemede, Gorev_Kodu = (int)CommandConstants.CMD_ERSALL_USER, IntParam_1 = 1, Kullanici_Adi = user.Kullanici_Adi, Panel_No = item, Tablo_Guncelle = true, Tarih = DateTime.Now }; _taskListService.sp_AddTaskList(taskList); } } else { foreach (var item in PanelList) { if (OprKod == CommandConstants.CMD_SND_USER) { TaskList maxUser = new TaskList { Deneme_Sayisi = 1, Durum_Kodu = (int)PanelStatusCode.Beklemede, Gorev_Kodu = (int)CommandConstants.CMD_SND_MAXUSERID, IntParam_1 = _userService.GetAllUsers().Max(x => x.ID), Kullanici_Adi = user.Kullanici_Adi, Panel_No = item, Tablo_Guncelle = true, Tarih = DateTime.Now }; _taskListService.sp_AddTaskList(maxUser); } TaskList taskList = new TaskList { Deneme_Sayisi = 1, Durum_Kodu = (int)PanelStatusCode.Beklemede, Gorev_Kodu = (int)OprKod, IntParam_1 = UserID, Kullanici_Adi = user.Kullanici_Adi, Panel_No = item, Tablo_Guncelle = true, Tarih = DateTime.Now }; _taskListService.sp_AddTaskList(taskList); _accessDatasService.AddOperatorLog(103, permissionUser.Kullanici_Adi, UserID, 0, 0, 0); } } } catch (Exception) { throw new Exception("Upss! Yanlış Giden Birşeyler Var."); } } }
protected CreateCommand(ITravellerFactory travellerFactory, IDataStore dataStore, CommandConstants commandConstants) { this.TravellerFactory = travellerFactory; this.DataStore = dataStore; this.CommandConstants = commandConstants; }
public ListVehiclesCommand(IDataStore dataStore, CommandConstants commandConstants) : base(dataStore, commandConstants) { }