예제 #1
0
        public ActionResult UpdateConfirmation(Staff staff)
        {
            var repo          = new StaffRepository();
            var updateStudent = repo.UpdateOfStaff(staff);

            return(View());
        }
예제 #2
0
        public ActionResult DetailsOfStaff(int StaffID)
        {
            var repo        = new StaffRepository();
            var staffDetail = repo.StaffDetail(StaffID);

            return(View(staffDetail));
        }
예제 #3
0
        //Update
        public ActionResult GettingStaffDetails(int StaffID)
        {
            var repo         = new StaffRepository();
            var staffDetails = repo.GettingStaffDetails(StaffID);

            return(View(staffDetails));
        }
예제 #4
0
        public ActionResult AllStaff()
        {
            var repo     = new StaffRepository();
            var allStaff = repo.GetAllStaff();

            return(View(allStaff));
        }
예제 #5
0
        public ActionResult CreateStaff(Staff staff)
        {
            var repo      = new StaffRepository();
            var repoStaff = repo.InsertStaff(staff);

            return(View(repoStaff));
        }
 public MovieController(MovieRepository repo, StaffRepository staffRepo, CastingRepository castRepo, CommentRepository cmtRepo)
 {
     this._repo      = repo;
     this._staffRepo = staffRepo;
     this._castRepo  = castRepo;
     this._cmtRepo   = cmtRepo;
 }
예제 #7
0
        public ActionResult DeletingOfStaff(int StaffID)
        {
            var repo        = new StaffRepository();
            var deleteStaff = repo.DeleteStaff(StaffID);

            return(View(deleteStaff));
        }
        public void Get_staff_returns_staff()
        {
            using (var context = new FIFContext(ContextOptions))
            {
                var repository = new StaffRepository(context);
                var result     = repository.All().Result;

                result.Count.ShouldBe(2);

                result.ShouldSatisfyAllConditions(
                    () => result.ElementAt(0).StaffKey.ShouldBe(1),
                    () => result.ElementAt(0).PersonalTitlePrefix.ShouldBe("Sr."),
                    () => result.ElementAt(0).FirstName.ShouldBe("Joe"),
                    () => result.ElementAt(0).MiddleName.ShouldBe("J."),
                    () => result.ElementAt(0).LastSurname.ShouldBe("Doe"),
                    () => result.ElementAt(0).StaffUniqueId.ShouldBe("1"));

                result.ShouldSatisfyAllConditions(
                    () => result.ElementAt(1).StaffKey.ShouldBe(2),
                    () => result.ElementAt(1).PersonalTitlePrefix.ShouldBe("Sr."),
                    () => result.ElementAt(1).FirstName.ShouldBe("Cody"),
                    () => result.ElementAt(1).MiddleName.ShouldBe("C."),
                    () => result.ElementAt(1).LastSurname.ShouldBe("Smith"),
                    () => result.ElementAt(1).StaffUniqueId.ShouldBe("2"));
            }
        }
예제 #9
0
        public dynamic GetAllStaff()
        {
            StaffRepository repo      = new StaffRepository();
            var             listStaff = repo.GetAll();

            return(listStaff);
        }
예제 #10
0
        private void InitFilter()
        {
            ComplexFilterParams = new CardFilterParams();

            var staffRepository      = new StaffRepository();
            var filterDepartmentList = staffRepository.GetDepartments();
            var filterStaffList      = staffRepository.GetAll(staff => staff.Name.DisplayName);

            _filterStaffCheckList = new ObservableCollection <CheckBoxItem <Staff> >();
            foreach (var staff in filterStaffList)
            {
                FilterStaffCheckList.Add(new CheckBoxItem <Staff> {
                    Item = staff
                });
            }
            OnPropertyChanged("FilterStaffCheckList");

            _filterDepartmentCheckList = new ObservableCollection <CheckBoxItem <string> >();
            foreach (var department in filterDepartmentList)
            {
                FilterDepartmentCheckList.Add(new CheckBoxItem <string> {
                    Item = department
                });
            }
            OnPropertyChanged("FilterDepartmentCheckList");
        }
예제 #11
0
        private void LoginBtn_Click_1(object sender, EventArgs e)
        {
            IStaffRepository staffRepository = new StaffRepository();
            IAdminRepository adminRepository = new AdminRepository();
            Admin            admin           = adminRepository.Login(UserTxt.Text, PassTxt.Text);

            if (admin != null)
            {
                AdminPannel pannel = new AdminPannel(admin.ClinicId);
                pannel.Show();
                this.Hide();
            }
            else
            {
                Staff user = staffRepository.Login(UserTxt.Text, PassTxt.Text);
                if (user != null)
                {
                    ClerkPannel pannel = new ClerkPannel(user.ClinicId);
                    pannel.Hide();
                    this.Close();
                }

                else
                {
                    MessageBox.Show("چنین کاربری در سیستم وجود ندارد", "خطا", MessageBoxButtons.OK);
                }
            }
        }
예제 #12
0
        public StaffModel GetTranslatorById(string translatorId, string cultureId)
        {
            StaffModel _model = null;

            try
            {
                IUnitOfWork      ouw     = new UnitOfWork();
                IStaffRepository rep     = new StaffRepository(ouw);
                IStaffService    service = new StaffService(rep);
                var data = service.GetTranslatorByID(new BaseViewModel()
                {
                    ID = Guid.Parse(translatorId), CurrentCulture = cultureId
                });

                if (data != null)
                {
                    _model = data;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(_model);
        }
예제 #13
0
        private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var listView = (sender as ListView);
            var exp      = (listView.Parent as Expander);
            var h        = int.Parse((listView.SelectedItem as TextBlock).Text.Substring(0, (listView.SelectedItem as TextBlock).Text.IndexOf(':')));

            Schedules scheduleNew = new Schedules
            {
                TimeStart = new DateTime(CalendarSmall.SelectedDate.Value.Year, CalendarSmall.SelectedDate.Value.Month, CalendarSmall.SelectedDate.Value.Day, h, 0, 0),
                Date      = CalendarSmall.SelectedDate.Value,
                Duration  = 1,
                Coach     = StaffRepository.GetInstance().Get(int.Parse(exp.DataContext.ToString())),
                Services  = new AdditionalServices()
            };

            SchedulesRepository.GetInstance().Add(scheduleNew);
            var schedule = SchedulesRepository.GetInstance().GetAll();

            list      = new List <Schedules>();
            coachList = new List <Staff>();

            foreach (var item in schedule)
            {
                if (item.Date == CalendarSmall.SelectedDate)
                {
                    coachList.Add(item.Coach);
                    list.Add(item);
                }
            }
            var listSchedule = list.Where(item => item.Coach.Id == int.Parse(exp.DataContext.ToString())).ToList();

            exp.Content = null;
            exp.Content = SetGraficOfOne(listSchedule);
        }
예제 #14
0
        public void Setup()
        {
            var repo = new StaffRepository();

            //Grab the first staff member form the list
            _staff = repo.GetStaff().First();
        }
예제 #15
0
        public bool ChangePassword(Guid staffId, string password)
        {
            bool changepass = false;

            try
            {
                IUnitOfWork      ouw     = new UnitOfWork();
                IStaffRepository rep     = new StaffRepository(ouw);
                IStaffService    service = new StaffService(rep);


                var result = rep.GetStaffById(staffId);

                if (result != null)
                {
                    result.Password = Utility.MD5(password);
                    rep.UpdateStaff(result);
                }
            }
            catch (Exception ex)
            {
                changepass = false;
                IErrorLogService errorLog = new ErrorLogService();
                string           message  = ex.InnerException != null ? ex.InnerException.InnerException.Message : ex.Message;
                throw new Exception(ex.Message);
            }

            return(changepass);
        }
예제 #16
0
 public StaffConfigController(StaffRepository sr, ApplicationDbContext aDbContext, UserManager <IdentityUser> um)
 {
     _sr         = sr;
     _aDbContext = aDbContext;
     // _rm = rm;
     _um = um;
 }
예제 #17
0
        private void InitViewModel(Staff status)
        {
            _staffRepository = new StaffRepository();
            Staff            = status;

            SaveCommand  = new RelayCommand(x => SaveMethod());
            CloseCommand = new RelayCommand(x => CloseMethod());
        }
예제 #18
0
        public bool Delete(int id)
        {
            bool            status = false;
            StaffRepository repo   = new StaffRepository();

            status = repo.Delete(id);
            return(status);
        }
예제 #19
0
        private void InitViewModel()
        {
            Repository = new StaffRepository();

            AddCommand    = new RelayCommand(x => AddMethod());
            EditCommand   = new RelayCommand(x => EditMethod());
            DeleteCommand = new RelayCommand(x => DeleteMethod());
        }
예제 #20
0
 public HomeController(UserManager <ApplicationUser> userManager,
                       CustomerRepository customerRepository,
                       StaffRepository staffRepository)
 {
     _userManager        = userManager;
     _customerRepository = customerRepository;
     _staffRepository    = staffRepository;
 }
예제 #21
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public StaffRepository Staffs()
 {
     if (_staffs == null)
     {
         _staffs = new StaffRepository(context);
     }
     return(_staffs);
 }
예제 #22
0
        public bool SaveData(Staff staff)
        {
            bool            status = true;
            Staff           staffs = new Staff();
            StaffRepository repo   = new StaffRepository();

            status = repo.SaveEdit(ParserAddStaff(staff));
            return(status);
        }
예제 #23
0
 public OrganizationService()
 {
     _departmentRepository             = new DepartmentRepository();
     _staffRepository                  = new StaffRepository();
     _applicationLoggingRepository     = new ApplicationLoggingRepository();
     _systemConfigDepartmentRepository = new SystemConfigDepartmentRepository();
     _departmentStaffsRepository       = new DepartmentStaffsRepository();
     _userRepository = new AspNetUsersRepository();
 }
예제 #24
0
        private StaffRepository SetUpSut()
        {
            var sessionProviderMock = new Mock<ISessionProvider>();
            sessionProviderMock.Setup(x => x.GetSession()).Returns(Session);
            var keywordsSearchService = new Mock<IKeywordsSearchService> ();

            var sut = new StaffRepository(sessionProviderMock.Object, keywordsSearchService.Object);
            return sut;
        }
예제 #25
0
 public void Can_Successfully_Create_Staff_In_Database()
 {
     using (var repo = new StaffRepository(_context))
     {
         repo.Create(sampleEmployee);
         Staff employee = _context.Staffs.Single();
         Assert.IsNotNull(employee);
         _transaction.Rollback();
     }
 }
예제 #26
0
        public void Get_staff_by_key_returns_null_when_it_does_not_exist()
        {
            using (var context = new FIFContext(ContextOptions))
            {
                var repository = new StaffRepository(context);
                var result     = repository.Get(999).Result;

                result.ShouldBeNull();
            }
        }
예제 #27
0
        /// <summary>
        /// Getstaffs the specified staff id.
        /// </summary>
        /// <param name="staffId">The staff id.</param>
        public Staff Getstaff(int staffId)
        {
            StaffRepository staffRep  = new StaffRepository();
            Staff           staffInfo = new Staff {
                StaffId = staffId
            };

            staff = staffRep.GetStaffByStaffId(staffInfo);
            return(staff);
        }
 public EntityService()
 {
     _bookService       = new BooksRepository();
     _studentService    = new StudentsRepository();
     _genresService     = new GenresRepository();
     _departmentService = new DepartmentRepository();
     _staffService      = new StaffRepository();
     _bookissueService  = new BookIssueRepository();
     _bookreturnService = new BookReturnRepository();
 }
예제 #29
0
 protected virtual void Dispose(bool disposing)
 {
     using (IStaffDal _staffDal = new StaffRepository())
     {
         if (disposing)
         {
             _staffDal.Dispose();
         }
     }
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            //Staffs tablosuna girilen veriler girilecek cmbStaffType'da MutfakElemanı->StaffTypeID2 Garson->StaffTypeID3 Vale->StaffTypeID4

            try
            {
                Staff staff = new Staff();

                staff.StaffName    = txtStaffName.Text;
                staff.StaffSurname = txtStaffSurname.Text;
                staff.StaffPhone   = txtStaffPhoneMasked.Text;
                if (cmbBranch.SelectedIndex == 0)
                {
                    staff.StaffBranchID = 1;
                }
                else if (cmbBranch.SelectedIndex == 1)
                {
                    staff.StaffBranchID = 2;
                }
                else if (cmbBranch.SelectedIndex == 2)
                {
                    staff.StaffBranchID = 3;
                }
                if (cmbStaffType.SelectedIndex == 0)
                {
                    staff.StaffTypeID = 2;
                }
                else if (cmbStaffType.SelectedIndex == 1)
                {
                    staff.StaffTypeID = 3;
                }
                else if (cmbStaffType.SelectedIndex == 2)
                {
                    staff.StaffTypeID = 4;
                }
                if (cmbGender.SelectedIndex == 0)
                {
                    staff.StaffGender = "Kadın";
                }
                else if (cmbGender.SelectedIndex == 1)
                {
                    staff.StaffGender = "Erkek";
                }
                staff.CreatorID = 2;
                staff.CreatDate = DateTime.Now;

                StaffRepository staffRepository = new StaffRepository();
                staffRepository.Add(staff);
                MessageBox.Show("Kayıt Başarılı Bir Şekilde Oluştu.");
            }
            catch
            {
                MessageBox.Show("Bir sorun oluştu lütfen bilgileri doğru giriniz");
            }
        }
예제 #31
0
        public Staff GetStaff(int id)
        {
            Staff           staffs = new Staff();
            StaffRepository repo   = new StaffRepository();

            if (staffs != null)
            {
                staffs = ParserStaff(repo.Get(id));
            }
            return(staffs);
        }