Beispiel #1
0
        public EmployeeAnalysis(IUnitOfWork unitOfWork, ITourAnalysisService serivce)
        {
            _unitOfWork = unitOfWork;
            _serivce    = serivce;
            _origin     = _unitOfWork.Employees.GetAll();
            _arr        = _origin.ToList();

            InitializeComponent();

            this.LoadComboSex();


            _serivce.FilterEmployeeByDate(_arr, DateTime.MinValue.Date, DateTime.MaxValue.Date);

            this.LoadGridView();

            this.SetUpGridView();

            gridView.ClearSelection();
            this.ShowDialog();
        }
        public SelectPersonDialog(IUnitOfWork unitOfWork, ITourAnalysisService service, DateTime from, DateTime to,
                                  IList <Customer> cusAvai, IList <GroupDetail> groupDetails, IList <GroupDetail> groupDetsModified, int nextId)
        {
            InitializeComponent();

            _unitOfWork        = unitOfWork;
            _service           = service;
            _from              = from;
            _to                = to;
            _groupDets         = groupDetails;
            _groupDetsModified = groupDetsModified;
            _forAttendant      = false;
            _origin            = cusAvai.Cast <Person>().ToList();
            _nextId            = nextId;
            this.Text          = "Chọn khách hàng";
            confirmMsg         = this.Text + " này?";
            boxJob.Visible     = false;
            LoadComboSex();
            LoadGridView();
            SetUpGridView();
        }
        public SelectPersonDialog(IUnitOfWork unitOfWork, ITourAnalysisService service, DateTime from, DateTime to,
                                  IList <Employee> empsAvai, IList <Attendant> attendants, IList <Attendant> attendantsModified, int nextId, IList <Job> jobs)
        {
            InitializeComponent();

            _unitOfWork         = unitOfWork;
            _service            = service;
            _from               = from;
            _to                 = to;
            _attendants         = attendants;
            _attendantsModified = attendantsModified;
            _jobs               = jobs;
            _forAttendant       = true;
            _origin             = empsAvai.Cast <Person>().ToList();
            _nextId             = nextId;
            this.Text           = "Chọn nhân viên";
            confirmMsg          = this.Text + " này?";
            LoadComboSex();
            LoadComboJob();
            LoadGridView();
            SetUpGridView();
        }
Beispiel #4
0
        public TourAnalysis(IUnitOfWork unitOfWork, ITourAnalysisService service)
        {
            InitializeComponent();
            _unitOfWork = unitOfWork;
            _service    = service;

            this._tours          = _unitOfWork.Tours.GetAll();
            this._toursForSearch = _tours.ToList();
            this._tourTypes      = _unitOfWork.TourTypes.GetAll();
            this.LoadComboTourType();
            this.LoadComboStatus(this.comboTourStatus);
            this.LoadComboStatus(this.comboGroupStatus);
            LoadTours();

            this.LoadTourGridView();


            this.SetUpTourGridView();
            dateTo.MinDate = dateFrom.Value.Date;

            this.ShowDialog();
        }
Beispiel #5
0
 public MainForm(IUnitOfWork unitOfWork, ITourAnalysisService tourAnalysisService)
 {
     _unitOfWork          = unitOfWork;
     _tourAnalysisService = tourAnalysisService;
     InitializeComponent();
 }
Beispiel #6
0
        public GroupForm(IUnitOfWork unitOfWork, ITourAnalysisService service, Tour tour, Group group, bool toView)
        {
            InitializeComponent();

            _unitOfWork = unitOfWork;
            _service    = service;

            _tour               = tour;
            _jobs               = _unitOfWork.Jobs.GetAll();
            _jobsAvailable      = _jobs.Where(m => m.Status.Equals(STATUS.AVAILABLE)).ToList();
            _costTypes          = _unitOfWork.CostTypes.GetAll();
            _customers          = _unitOfWork.Customers.GetAll();
            _employees          = _unitOfWork.Employees.GetAll();
            _prices             = _unitOfWork.Tours.GetPricesByTourId(_tour.Id).Where(m => DateTime.Compare(m.EndDate.Date, DateTime.Today) >= 0).OrderBy(m => m.StartDate).ToList();
            _customersAvailable = _customers.Where(m => m.Status.Equals(STATUS.AVAILABLE)).ToList();
            _employeesAvailable = _employees.Where(m => m.Status.Equals(STATUS.AVAILABLE)).ToList();

            if (group == null)
            {
                this.hideId();
                _attendants  = new List <Attendant>();
                _groupDets   = new List <GroupDetail>();
                _costs       = new List <Cost>();
                txtName.Text = _tour.Name;
                title        = "Thêm đoàn khách";
            }
            else
            {
                _toBeEdited           = true;
                _model                = group;
                _attendants           = _unitOfWork.Tours.GetAttendantsByGroupId(_model);
                _nextAttendantIndex   = _attendants.Any() ? _attendants.Last().Id : 0;
                _groupDets            = _unitOfWork.Tours.GetGroupDetailsByGroupId(_model);
                _nextGroupDetailIndex = _groupDets.Any() ? _groupDets.Last().Id : 0;
                _costs                = _unitOfWork.Tours.GetCostsByGroupId(_model);
                title = "Cập nhật đoàn khách";
                LoadModel();
            }

            confirmMsg = title + " này?";

            this.Text = title;

            LoadCosts();

            LoadPersons(_forCustomer);

            SetUpGridCost();
            if (_forCustomer)
            {
                this.SetUpGridGroupDetail();
            }
            else
            {
                this.SetUpGridAttendant();
            }


            this.dateStart.MinDate = this.dateStart.Value.Date;
            this.dateEnd.MinDate   = this.dateStart.Value.Date;

            if (_model != null && DateTime.Compare(_model.EndDate.Date, DateTime.Today) < 0)
            {
                dateStart.Enabled = false;
                dateEnd.Enabled   = false;
            }
            if (toView)
            {
                btnAddCost.Visible    = false;
                btnEditCost.Visible   = false;
                btnDeleteCost.Visible = false;

                btnOk.Visible     = false;
                btnCancel.Visible = false;

                btnAddPerson.Visible    = false;
                btnDeletePerson.Visible = false;
                btnShowPrice.Visible    = false;
                dateStart.Enabled       = false;
                dateEnd.Enabled         = false;

                btnOKView.Visible = true;
            }
        }