public BirimController(IDBUsersService dBUsersService, IBolumService bolumService, IAltDepartmanService altDepartmanService, IDepartmanService departmanService, IBirimService birimService, IDBUsersDepartmanService dBUsersDepartmanService, IDBUsersSirketService dBUsersSirketService, IDBUsersPanelsService dBUsersPanelsService) { //user = CurrentSession.User; //if (user == null) //{ // user = new DBUsers(); //} _bolumService = bolumService; _dBUsersService = dBUsersService; _altDepartmanService = altDepartmanService; _departmanService = departmanService; _birimService = birimService; _dBUsersPanelsService = dBUsersPanelsService; _dBUsersDepartmanService = dBUsersDepartmanService; _dBUsersSirketService = dBUsersSirketService; dbDepartmanList = new List <int>(); dbPanelList = new List <int>(); dbSirketList = new List <int>(); foreach (var dbUserDepartmanNo in _dBUsersDepartmanService.GetAllDBUsersDepartman(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Departman_No)) { dbDepartmanList.Add((int)dbUserDepartmanNo); } foreach (var dbUserPanelNo in _dBUsersPanelsService.GetAllDBUsersPanels(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Panel_No)) { dbPanelList.Add((int)dbUserPanelNo); } foreach (var dbUserSirketNo in _dBUsersSirketService.GetAllDBUsersSirket(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Sirket_No)) { dbSirketList.Add((int)dbUserSirketNo); } permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public DoorGroupController(IDoorGroupsDetailService doorGroupsDetailService, IDoorGroupsMasterService doorGroupsMasterService, IGroupsDetailNewService groupsDetailNewService, IGroupMasterService groupMasterService, IReaderSettingsNewService readerSettingsNewService, IReportService reportService, IPanelSettingsService panelSettingsService, IDBUsersService dBUsersService, IDBUsersPanelsService dBUsersPanelsService, IDBUsersKapiService dBUsersKapiService) { //dBUsers = CurrentSession.User; //if (dBUsers == null) //{ // dBUsers = new DBUsers(); //} _doorGroupsDetailService = doorGroupsDetailService; _doorGroupsMasterService = doorGroupsMasterService; _groupsDetailNewService = groupsDetailNewService; _groupMasterService = groupMasterService; _readerSettingsNewService = readerSettingsNewService; _reportService = reportService; _panelSettingsService = panelSettingsService; _dBUsersService = dBUsersService; _dBUsersPanelsService = dBUsersPanelsService; _dBUsersKapiService = dBUsersKapiService; dbPanelList = new List <int>(); dbDoorList = new List <int>(); foreach (var dbUserPanelNo in _dBUsersPanelsService.GetAllDBUsersPanels(x => x.Kullanici_Adi == dBUsers.Kullanici_Adi).Select(a => a.Panel_No)) { dbPanelList.Add((int)dbUserPanelNo); } foreach (var dbUserDoorNo in _dBUsersKapiService.GetAllDBUsersKapi(x => x.Kullanici_Adi == dBUsers.Kullanici_Adi).Select(a => a.Kapi_Kayit_No)) { dbDoorList.Add((int)dbUserDoorNo); } permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == dBUsers.Kullanici_Adi); }
public AccessReceiveController(IProgInitService progInitService, ITaskListService taskListService, IPanelSettingsService panelSettingsService, IDBUsersService dBUsersService, IReportService reportService, IDBUsersDepartmanService dBUsersDepartmanService, IDBUsersSirketService dBUsersSirketService, IDBUsersPanelsService dBUsersPanelsService) { user = CurrentSession.User; if (user == null) { user = new DBUsers(); } _progInitService = progInitService; _taskListService = taskListService; _panelSettingsService = panelSettingsService; _dBUsersService = dBUsersService; _reportService = reportService; _dBUsersPanelsService = dBUsersPanelsService; _dBUsersDepartmanService = dBUsersDepartmanService; _dBUsersSirketService = dBUsersSirketService; dbDepartmanList = new List <int>(); dbPanelList = new List <int>(); dbSirketList = new List <int>(); foreach (var dbUserDepartmanNo in _dBUsersDepartmanService.GetAllDBUsersDepartman(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Departman_No)) { dbDepartmanList.Add((int)dbUserDepartmanNo); } foreach (var dbUserPanelNo in _dBUsersPanelsService.GetAllDBUsersPanels(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Panel_No)) { dbPanelList.Add((int)dbUserPanelNo); } foreach (var dbUserSirketNo in _dBUsersSirketService.GetAllDBUsersSirket(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Sirket_No)) { dbSirketList.Add((int)dbUserSirketNo); } permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public async void Authorize() { User user = await DBUsers.Authorize(loginField.text, passwordField.text); SetUserData(user); if (user == null) { return; } UserController userController = UserController.GetInstance(); if (userController == null) { return; } userController.user = user; LevelManager.GetInstance()?.LoadMainMenu(); //if (savePassword.isOn) //{ // SetUserData(new User() { userName = loginField.text, password = passwordField.text }); //} //else //{ // ClearUserData(); //} //canvasController.SelectCanvas((int)userData.role + 1); }
public WatchController(IAccessDatasService accessDatasService, IUserService userService, IReportService reportService, IProgInitService progInitService, IDBUsersService dBUsersService) { //user = CurrentSession.User; //if (user == null) //{ // user = new DBUsers(); //} WtchPrmtrs = CurrentSession.Get <WatchParameters>("WatchParameter"); if (WtchPrmtrs == null) { WtchPrmtrs = new WatchParameters(); } _accessDatasService = accessDatasService; _userService = userService; _reportService = reportService; _progInitService = progInitService; _dBUsersService = dBUsersService; _reportService.GetPanelList(user == null ? new DBUsers { } : user); _reportService.GetDoorList(user == null ? new DBUsers { } : user); _reportService.GetSirketList(user == null ? new DBUsers { } : user); _reportService.GetDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetAltDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetBolumList(user == null ? new DBUsers { } : user); _reportService.GetPanelAndDoorListForSpotMonitor(user == null ? new DBUsers { } : user); permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public SMSController(ISmsSettingsService smsSettingsService, IAccessDatasService accessDatasService, IDBUsersService dBUsersService, IUserService userService, ISMSForPanelStatusService sMSForPanelStatusService, IReportService reportService) { user = CurrentSession.User; if (user == null) { user = new DBUsers(); } _smsSettingsService = smsSettingsService; _accessDatasService = accessDatasService; _dBUsersService = dBUsersService; _reportService = reportService; _userService = userService; _sMSForPanelStatusService = sMSForPanelStatusService; _reportService.GetPanelList(user == null ? new DBUsers { } : user); _reportService.GetDoorList(user == null ? new DBUsers { } : user); _reportService.GetSirketList(user == null ? new DBUsers { } : user); _reportService.GetDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetAltDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetBolumList(user == null ? new DBUsers { } : user); permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
IEnumerator SetRankingData(int uid, string uname, int upoint) { DBUsers updateData = new DBUsers(); updateData.id = uid; updateData.name = uname; updateData.point = upoint; string updateDataJson = JsonUtility.ToJson(updateData); WWWForm form = new WWWForm(); form.AddField("user", updateDataJson); using (WWW www = new WWW(setRanking_url, form)) { yield return(www); if (!string.IsNullOrEmpty(www.error)) { Debug.LogError("error : " + www.error); yield break; } } }
public AlarmController(IAlarmlarService alarmlarService, IAlarmTipleriService alarmTipleriService, IUserService userService, IPanelSettingsService panelSettingsService, ITaskListService taskListService, IDBUsersPanelsService dBUsersPanelsService, IDBUsersService dBUsers, IReportService reportService, IAccessDatasService accessDatasService, IDBUsersDepartmanService dBUsersDepartmanService, IDBUsersSirketService dBUsersSirketService, IDBUsersAltDepartmanService dBUsersAltDepartmanService, IReaderSettingsNewService readerSettingsNewService, IDBUsersKapiService dBUsersKapiService, IAccessDatasTempService accessDatasTempService) { //user = CurrentSession.User; //if (user == null) //{ // user = new DBUsers(); //} _alarmlarService = alarmlarService; _alarmTipleriService = alarmTipleriService; _userService = userService; _panelSettingsService = panelSettingsService; _taskListService = taskListService; _dBUsers = dBUsers; _reportService = reportService; _accessDatasService = accessDatasService; _dBUsersPanelsService = dBUsersPanelsService; _dBUsersDepartmanService = dBUsersDepartmanService; _dBUsersSirketService = dBUsersSirketService; _dBUsersAltDepartmanService = dBUsersAltDepartmanService; _readerSettingsNewService = readerSettingsNewService; _dBUsersKapiService = dBUsersKapiService; _accessDatasTempService = accessDatasTempService; dbDepartmanList = new List <int>(); dbPanelList = new List <int>(); dbDoorList = new List <int>(); dbSirketList = new List <int>(); dbAltDepartmanList = new List <int>(); foreach (var dbUserDepartmanNo in _dBUsersDepartmanService.GetAllDBUsersDepartman(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Departman_No)) { dbDepartmanList.Add((int)dbUserDepartmanNo); } foreach (var dbUserPanelNo in _dBUsersPanelsService.GetAllDBUsersPanels(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Panel_No)) { dbPanelList.Add((int)dbUserPanelNo); } foreach (var dbUserDoorNo in _dBUsersKapiService.GetAllDBUsersKapi(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Kapi_Kayit_No)) { dbDoorList.Add((int)dbUserDoorNo); } foreach (var dbUserSirketNo in _dBUsersSirketService.GetAllDBUsersSirket(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Sirket_No)) { dbSirketList.Add((int)dbUserSirketNo); } foreach (var dbUserAltDepartmanNo in _dBUsersAltDepartmanService.GetAllDBUsersAltDepartman(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Alt_Departman_No)) { dbAltDepartmanList.Add((int)dbUserAltDepartmanNo); } _reportService.GetPanelList(user == null ? new DBUsers { } : user); _reportService.GetSirketList(user == null ? new DBUsers { } : user); _reportService.GetDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetAltDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetBolumList(user == null ? new DBUsers { } : user); permissionUser = _dBUsers.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public void sp_SendAllUserToAllPanel(DBUsers users) { using (var context = new ForaContext()) { SqlParameter parameter = new SqlParameter("@userName", users.Kullanici_Adi); context.Database.ExecuteSqlCommand("sp_AllUsersToAllPanels @userName", parameter); } }
public void sp_SendAllUserOnePanel(DBUsers users, int PanelId) { using (var context = new ForaContext()) { SqlParameter parameterPanelId = new SqlParameter("@panelID", PanelId); SqlParameter parameterUserName = new SqlParameter("@userName", users.Kullanici_Adi); context.Database.ExecuteSqlCommand("sp_AllUserOnePanel @panelID, @userName", parameters: new[] { parameterPanelId, parameterUserName }); } }
public RefectoryController(IReaderSettingsNewService readerSettingsNewService, IPanelSettingsService panelSettingsService, IReportService reportService, IDBUsersService dBUsersService, IGroupMasterService groupMasterService, IGroupsDetailNewService groupsDetailNewService, IDoorGroupsMasterService doorGroupsMasterService, IDoorGroupsDetailService doorGroupsDetailService, IEmailSettingsService emailSettingsService, ISirketService sirketService, IDepartmanService departmanService, IAltDepartmanService altDepartmanService, IBolumService bolumService, IBirimService birimService, IDBUsersDepartmanService dBUsersDepartmanService, IDBUsersSirketService dBUsersSirketService, IDBUsersPanelsService dBUsersPanelsService, IDBUsersAltDepartmanService dBUsersAltDepartmanService) { //user = CurrentSession.User; //if (user == null) //{ // user = new DBUsers(); //} _readerSettingsNewService = readerSettingsNewService; _panelSettingsService = panelSettingsService; _reportService = reportService; _dBUsersService = dBUsersService; _groupMasterService = groupMasterService; _groupsDetailNewService = groupsDetailNewService; _doorGroupsDetailService = doorGroupsDetailService; _doorGroupsMasterService = doorGroupsMasterService; _emailSettingsService = emailSettingsService; _sirketService = sirketService; _departmanService = departmanService; _altDepartmanService = altDepartmanService; _bolumService = bolumService; _birimService = birimService; _dBUsersPanelsService = dBUsersPanelsService; _dBUsersDepartmanService = dBUsersDepartmanService; _dBUsersSirketService = dBUsersSirketService; _dBUsersAltDepartmanService = dBUsersAltDepartmanService; dbDepartmanList = new List <int>(); dbPanelList = new List <int>(); dbSirketList = new List <int>(); dbAltDepartmanList = new List <int>(); foreach (var dbUserDepartmanNo in _dBUsersDepartmanService.GetAllDBUsersDepartman(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Departman_No)) { dbDepartmanList.Add((int)dbUserDepartmanNo); } foreach (var dbUserPanelNo in _dBUsersPanelsService.GetAllDBUsersPanels(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Panel_No)) { dbPanelList.Add((int)dbUserPanelNo); } foreach (var dbUserSirketNo in _dBUsersSirketService.GetAllDBUsersSirket(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Sirket_No)) { dbSirketList.Add((int)dbUserSirketNo); } foreach (var dbUserAltDepartmanNo in _dBUsersAltDepartmanService.GetAllDBUsersAltDepartman(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Alt_Departman_No)) { dbAltDepartmanList.Add((int)dbUserAltDepartmanNo); } _reportService.GetPanelList(user == null ? new DBUsers { } : user); _reportService.GetSirketList(user == null ? new DBUsers { } : user); _reportService.GetDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetAltDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetBolumList(user == null ? new DBUsers { } : user); permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public string GetCurrentUsername() { DBUsers user = CurrentSession.User; if (user != null) { return(user.Kullanici_Adi); } return("System"); }
public void UtilizeState(object state) { SendedObject InData = state as SendedObject; CurrentUser = InData.SendedUser; HowToSort.Items.Add("Времени в пути"); HowToSort.Items.Add("Цене за 1 кг"); Order.Items.Add("По возрастанию"); Order.Items.Add("По убыванию"); }
public DBUsers LoginUsers(LoginViewModel model) { DBUsers user = _dBUsersDal.Get(x => x.Kullanici_Adi == model.Username && x.Sifre == model.Password); if (user == null) { return(null); } return(user); }
public UnvanController(IUnvanService unvanService, IDBUsersService dBUsersService) { dBUsers = CurrentSession.User; if (dBUsers == null) { dBUsers = new DBUsers(); } _dBUsersService = dBUsersService; _unvanService = unvanService; permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == dBUsers.Kullanici_Adi); }
/// <summary> /// Login User /// </summary> /// <param name="userName">User Name or email</param> /// <param name="password">Password</param> /// <returns>User matching with User Name and Password</returns> public static User LoginUser(string userName, string password) { try { return(DBUsers.LoginUser(userName, password)); } catch (Exception ex) { throw ex; } }
public EmploymentController(IGorevlerService gorevlerService, IDBUsersService dBUsersService) { user = CurrentSession.User; if (user == null) { user = new DBUsers(); } _gorevlerService = gorevlerService; _dBUsersService = dBUsersService; permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public void UtilizeState(object state) { SendedObject InData = state as SendedObject; CurrentUser = InData.SendedUser; ShowStatus.Text += " " + CurrentUser.UserStatusV; ShowRegistrationDate.Text += " " + CurrentUser.RegistrarionDateV.ToShortDateString(); UsernameOut.Text = " " + CurrentUser.UsernameV; OrdersAmount(); LoadOrders(); }
public DBUsers UpdateDBUsers(DBUsers dBUsers) { if (dBUsers.Kullanici_Islemleri == null) { dBUsers.Kullanici_Islemleri = 3; } if (dBUsers.Grup_Islemleri == null) { dBUsers.Grup_Islemleri = 3; } if (dBUsers.Programli_Kapi_Islemleri == null) { dBUsers.Programli_Kapi_Islemleri = 3; } if (dBUsers.Gecis_Verileri_Rapor_Islemleri == null) { dBUsers.Gecis_Verileri_Rapor_Islemleri = 3; } if (dBUsers.Ziyaretci_Islemleri == null) { dBUsers.Ziyaretci_Islemleri = 3; } if (dBUsers.Canli_Izleme == null) { dBUsers.Canli_Izleme = 3; } if (dBUsers.Alarm_Islemleri == null) { dBUsers.Alarm_Islemleri = 3; } if (dBUsers.SysAdmin == null) { dBUsers.SysAdmin = false; } if (dBUsers.OtherDeviceReports == null) { dBUsers.OtherDeviceReports = false; } if (dBUsers.SysAdmin == true) { dBUsers.Kullanici_Islemleri = 1; dBUsers.Grup_Islemleri = 1; dBUsers.Programli_Kapi_Islemleri = 1; dBUsers.Gecis_Verileri_Rapor_Islemleri = 1; dBUsers.Ziyaretci_Islemleri = 1; dBUsers.Canli_Izleme = 1; dBUsers.Alarm_Islemleri = 1; dBUsers.OtherDeviceReports = true; } return(_dBUsersDal.Update(dBUsers)); }
public EmailController(IEmailSettingsService emailSettingsService, IAccessDatasService accessDatasService, IDBUsersService dBUsersService) { //user = CurrentSession.User; //if (user == null) //{ // user = new DBUsers(); //} _emailSettingsService = emailSettingsService; _accessDatasService = accessDatasService; _dBUsersService = dBUsersService; permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public BlockController(IBloklarService bloklarService, IDBUsersService dBUsersService, IAccessDatasService accessDatasService) { user = CurrentSession.User; if (user == null) { user = new DBUsers(); } _bloklarService = bloklarService; _dBUsersService = dBUsersService; _accessDatasService = accessDatasService; permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
/// <summary> /// Set password for the user /// </summary> /// <param name="user">Target User</param> /// <param name="password">Password to set</param> /// <returns>Count of affected rows</returns> public static int SetPassword(User user, string password) { try { user.Password = DBUsers.CalculateHashedPassword(password); return(DBUsers.Update(user)); } catch (Exception ex) { throw ex; } }
public HolidayController(ITatilGunuService tatilGunuService, IDBUsersService dBUsersService, IReportService reportService, IProgRelay2Service progRelay2Service) { user = CurrentSession.User; if (user == null) { user = new DBUsers(); } _tatilGunuService = tatilGunuService; _dBUsersService = dBUsersService; _reportService = reportService; _progRelay2Service = progRelay2Service; permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public CompanyController(ISirketService sirketService, IDBUsersService dBUsersService, IAccessDatasService accessDatasService, IDBUsersSirketService dBUsersSirketService) { user = CurrentSession.User; if (user == null) { user = new DBUsers(); } _sirketService = sirketService; _dBUsersService = dBUsersService; _accessDatasService = accessDatasService; _dBUsersSirketService = dBUsersSirketService; permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
/// <summary> /// Archive User /// </summary> /// <param name="user">User to Archive</param> /// <returns>Count of affected rows</returns> public static int ArchiveUser(User user) { try { user.Archived = DateTime.Now; user.ArchiverId = LoggedUser.Id; return(DBUsers.Update(user)); } catch (Exception) { throw; } }
public DepartmentController(IDepartmanService departmanService, IDBUsersService dBUsersService, IAccessDatasService accessDatasService, IDBUsersDepartmanService dBUsersDepartmanService) { user = CurrentSession.User; if (user == null) { user = new DBUsers(); } _departmanService = departmanService; _dBUsersService = dBUsersService; _accessDatasService = accessDatasService; _dBUsersDepartmanService = dBUsersDepartmanService; permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public FastGroupController(IGroupMasterService groupMasterService, IUnvanService unvanService, IUserService userService, IDBUsersService dBUsersService) { user = CurrentSession.User; if (user == null) { user = new DBUsers(); } _unvanService = unvanService; _groupMasterService = groupMasterService; _userService = userService; _dBUsersService = dBUsersService; permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }
public void UtilizeState(object state) { SendedObject InData = state as SendedObject; CurrentUser = InData.SendedUser; NewOrder = InData.Data as DBOrders; getOrderInfo(); Direction.Text = Direction.Text + " " + OrderInfo.Rows[0][0] + " - " + OrderInfo.Rows[0][1]; DepartureDate.Text = DepartureDate.Text + " " + Convert.ToDateTime(OrderInfo.Rows[0][2]).ToLongDateString(); DepartureTime.Text = DepartureTime.Text + " " + OrderInfo.Rows[0][3]; ArrivalTime.Text = ArrivalTime.Text + " " + OrderInfo.Rows[0][4]; NewOrder.OrderV = Convert.ToInt32(OrderInfo.Rows[0][5]) + 1; }
private void Enter(object sender, RoutedEventArgs e) { if (UsernameEntered.Text.Length == 0) { UsernameEntered.BorderBrush = Brushes.Red; UsernameError.Text = "Заполните это поле"; } if (PasswordEntered.Password.Length == 0) { PasswordEntered.BorderBrush = Brushes.Red; passwordError.Text = "Заполните это поле"; } if (UsernameError.Text == "" && passwordError.Text == "") { string sqlCommand = "select UserPassword from Users where Username = '******'"; SqlDataAdapter adapter = ConnectionToDatabase.GetRequestResult(sqlCommand); DataTable ThisUser = new DataTable(); DataTable ThisUserFound = new DataTable(); try { adapter.Fill(ThisUser); } catch (Exception ex) { Switcher.Switch(new pages.FirstPage()); } if (ThisUser.Rows.Count == 0) { UsernameEntered.BorderBrush = Brushes.Red; UsernameError.Text = "Пользователь не найден, проверьте введённые данные"; } else { if (Convert.ToString(ThisUser.Rows[0][0]) != PasswordEntered.Password) { PasswordEntered.BorderBrush = Brushes.Red; passwordError.Text = "Неверный пароль"; } else { sqlCommand = "select * from Users where Username = '******'"; adapter = ConnectionToDatabase.GetRequestResult(sqlCommand); adapter.Fill(ThisUserFound); DBUsers EnteredUser = new DBUsers((string)ThisUserFound.Rows[0][0], (string)ThisUserFound.Rows[0][1], (long)ThisUserFound.Rows[0][3], (string)ThisUserFound.Rows[0][2], (DateTime)ThisUserFound.Rows[0][4], (int)ThisUserFound.Rows[0][5]); SendedObject Send = new SendedObject(EnteredUser); Switcher.Switch(new UserMainPage(), Send); } } } }
public VisitorController(IVisitorsService visitorsService, IUserService userService, IGroupMasterService groupMasterService, ITaskListService taskListService, IPanelSettingsService panelSettingsService, IDBUsersPanelsService dBUsersPanelsService, IDBUsersService dBUsersService, IDBUsersSirketService dBUsersSirketService, IDBUsersDepartmanService dBUsersDepartmanService, IReportService reportService, IAccessDatasService accessDatasService, IDBUsersAltDepartmanService dBUsersAltDepartmanService) { //user = CurrentSession.User; //if (user == null) //{ // user = new DBUsers(); //} _visitorsService = visitorsService; _userService = userService; _groupMasterService = groupMasterService; _taskListService = taskListService; _panelSettingsService = panelSettingsService; _dBUsersPanelsService = dBUsersPanelsService; _dBUsersService = dBUsersService; _dBUsersDepartmanService = dBUsersDepartmanService; _dBUsersSirketService = dBUsersSirketService; _reportService = reportService; _accessDatasService = accessDatasService; _dBUsersAltDepartmanService = dBUsersAltDepartmanService; dbDepartmanList = new List <int>(); dbPanelList = new List <int>(); dbSirketList = new List <int>(); dbAltDepartmanList = new List <int>(); foreach (var dbUserDepartmanNo in _dBUsersDepartmanService.GetAllDBUsersDepartman(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Departman_No)) { dbDepartmanList.Add((int)dbUserDepartmanNo); } foreach (var dbUserPanelNo in _dBUsersPanelsService.GetAllDBUsersPanels(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Panel_No)) { dbPanelList.Add((int)dbUserPanelNo); } foreach (var dbUserSirketNo in _dBUsersSirketService.GetAllDBUsersSirket(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Sirket_No)) { dbSirketList.Add((int)dbUserSirketNo); } foreach (var dbUserAltDepartmanNo in _dBUsersAltDepartmanService.GetAllDBUsersAltDepartman(x => x.Kullanici_Adi == user.Kullanici_Adi).Select(a => a.Alt_Departman_No)) { dbAltDepartmanList.Add((int)dbUserAltDepartmanNo); } _reportService.GetPanelList(user == null ? new DBUsers { } : user); _reportService.GetSirketList(user == null ? new DBUsers { } : user); _reportService.GetDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetAltDepartmanList(user == null ? new DBUsers { } : user); _reportService.GetBolumList(user == null ? new DBUsers { } : user); permissionUser = _dBUsersService.GetAllDBUsers().Find(x => x.Kullanici_Adi == user.Kullanici_Adi); }