コード例 #1
0
        protected override void SubscribeEvent()
        {
            View.Loading += View_Loading;

            View.Save += async() => await SaveAsync();

            View.SelectionNomenclature += () =>
            {
                JournalsForm journal = new JournalsForm();

                JournalsPresenter <Nomenclature> presenter = new JournalsPresenter <Nomenclature>(journal, new NomenclatureJournal(journal.Grid, TypeNomernclature.Good));

                journal.ShowDialog();

                if (presenter.Info != null)
                {
                    NomenclatureModel nomenclature = (NomenclatureModel)presenter.Info;
                    _numberNomenclature = nomenclature.Number;
                    View.Nomenclature   = nomenclature.ShortName;
                    View.Price          = nomenclature.Price;
                    CalculateSum();
                }
            };

            View.CalculateSum += CalculateSum;
        }
コード例 #2
0
        private void SelectionCar()
        {
            JournalsForm journal = new JournalsForm();

            JournalsPresenter <Car> presenter = new JournalsPresenter <Car>(journal, new CarJournal(journal.Grid, _contractorID));

            journal.ShowDialog();

            if (presenter.Info != null)
            {
                CarModel car = (CarModel)presenter.Info;
                _carID   = car.ID;
                View.Car = GetCarText(car.Model.Name, car.VIN);
            }
        }
コード例 #3
0
        private void SelectionMark()
        {
            JournalsForm journal = new JournalsForm();

            JournalsPresenter <Mark> presenter = new JournalsPresenter <Mark>(journal, new MarkJournal(journal.Grid));

            journal.ShowDialog();

            if (presenter.Info != null)
            {
                MarkModel mark = (MarkModel)presenter.Info;
                _markID       = mark.ID;
                View.NameMark = mark.ShortName;
            }
        }
コード例 #4
0
        private void View_SelectionUnit()
        {
            JournalsForm journal = new JournalsForm();

            JournalsPresenter <Unit> presenter = new JournalsPresenter <Unit>(journal, new UnitJournal(journal.Grid));

            journal.ShowDialog();

            if (presenter.Info != null)
            {
                UnitModel unit = (UnitModel)presenter.Info;
                _codeUnit     = unit.Code;
                View.NameUnit = GetUnitText(unit.Name, unit.ShortName);
            }
        }
コード例 #5
0
        private void SelectionResponsible()
        {
            JournalsForm journal = new JournalsForm();

            JournalsPresenter <Employee> presenter = new JournalsPresenter <Employee>(journal, new EmployeeJournal(journal.Grid));

            journal.ShowDialog();

            if (presenter.Info != null)
            {
                EmployeeModel employee = (EmployeeModel)presenter.Info;

                _responsibleID   = employee.ID;
                View.Responsible = employee.FFP;
            }
        }
コード例 #6
0
        private void SelectionContractor()
        {
            JournalsForm journal = new JournalsForm();

            JournalsPresenter <Contractor> presenter = new JournalsPresenter <Contractor>(journal, new ContractorJournal(journal.Grid));

            journal.ShowDialog();

            if (presenter.Info != null)
            {
                ContractorModel contractor = (ContractorModel)presenter.Info;
                _contractorID             = contractor.ID;
                View.Contractor           = contractor.ShortName;
                View.EnabledContactPerson = true;
                View.EnabledCar           = true;
            }
        }
コード例 #7
0
        private void SelectionContactPerson()
        {
            JournalsForm journal = new JournalsForm();

            JournalsPresenter <ContactPerson> presenter = new JournalsPresenter <ContactPerson>(journal, new ContactPersonJournal(journal.Grid, _contractorID));

            journal.ShowDialog();

            if (presenter.Info != null)
            {
                ContactPersonModel contact = (ContactPersonModel)presenter.Info;

                _contractPersonID           = contact.ID;
                View.ContactPerson          = contact.FFP;
                View.EnabledPowerOfAttorney = true;
            }
        }
コード例 #8
0
        private void SelectionPowerOfAttorney()
        {
            JournalsForm journal = new JournalsForm();

            PowerOfAttorneyJournal powerOfAttorney = new PowerOfAttorneyJournal(journal.Grid, (Guid)_contractPersonID);

            JournalsPresenter <PowerOfAttorney> presenter = new JournalsPresenter <PowerOfAttorney>(journal, powerOfAttorney);

            journal.ShowDialog();

            if (presenter.Info != null)
            {
                PowerOfAttorneyModel power = (PowerOfAttorneyModel)presenter.Info;
                _powerOfAttorneyID   = power.ID;
                View.PowerOfAttorney = GetPowerOfAttorneyText(power.Number, power.Date);
            }
        }
コード例 #9
0
        protected override void SubscribeEvent()
        {
            View.Loading += View_Loading;

            View.Save += async() => await SaveAsync();


            View.SelectionNomenclature += () =>
            {
                JournalsForm journal = new JournalsForm();

                JournalsPresenter <Nomenclature> presenter = new JournalsPresenter <Nomenclature>(journal, new NomenclatureJournal(journal.Grid, TypeNomernclature.Work));

                journal.ShowDialog();

                if (presenter.Info != null)
                {
                    NomenclatureModel nomenclature = (NomenclatureModel)presenter.Info;
                    _numberNomenclature = nomenclature.Number;
                    View.Nomenclature   = nomenclature.ShortName;
                    View.NormOfTime     = nomenclature.Price;
                }
            };

            View.SelectionWorkingHour += () =>
            {
                JournalsForm journal = new JournalsForm();

                JournalsPresenter <WorkingHour> presenter = new JournalsPresenter <WorkingHour>(journal, new WorkingHourJournal(journal.Grid));

                journal.ShowDialog();

                if (presenter.Info != null)
                {
                    WorkingHourModel workingHour = (WorkingHourModel)presenter.Info;

                    _workingHourID        = workingHour.ID;
                    _price                = workingHour.Price;
                    View.NameWorkingHour  = workingHour.Name;
                    View.PriceWorkingHour = GetPriceText(workingHour.Price);
                    CalculateSum();
                }
            };

            View.CalculateSum += CalculateSum;
        }
コード例 #10
0
        internal override async Task AddRecord()
        {
            try
            {
                _journal = new JournalsForm();

                JournalsPresenter <Option> presenter = new JournalsPresenter <Option>(_journal, new OptionJournal(_journal.Grid, NumberApplication));

                _journal.ShowDialog();

                await Update();
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }
        }
コード例 #11
0
        protected override void SubscribeEvent()
        {
            View.Save += async() => await SaveAsync();

            View.Loading += View_Loading;

            View.SelectionReason += () =>
            {
                JournalsForm journal = new JournalsForm();

                JournalsPresenter <Reason> presenter = new JournalsPresenter <Reason>(journal, new ReasonJournal(journal.Grid, _numberApplication));

                journal.ShowDialog();

                if (presenter.Info != null)
                {
                    ReasonModel reason = (ReasonModel)presenter.Info;
                    _reasonID   = reason.ID;
                    View.Reason = GetReasonText(reason.ShortName, reason.Type);
                }
            };


            View.AddWork += AddWork;

            View.EditWork += EditWork;

            View.DeleteWork += DeleteWork;

            View.AddMaterial  += AddMaterial;
            View.EditMaterial += EditMaterial;


            View.DeleteMaterial += DeleteMaterial;

            View.AddMaterialCustomer += AddMaterialCustomer;

            View.EditMaterialCustomer   += EditMaterialCustomer;
            View.DeleteMaterialCustomer += DeleteMaterialCustomer;
        }
コード例 #12
0
        protected override void SubscribeEvent()
        {
            View.Save += async() => await SaveAsync();

            View.Loading += View_Loading;

            View.SelectionModel += () =>
            {
                JournalsForm journal = new JournalsForm();

                JournalsPresenter <GridView.Model> presenter = new JournalsPresenter <GridView.Model>(journal, new ModelJournal(journal.Grid));

                journal.ShowDialog();

                if (presenter.Info != null)
                {
                    ModelModel model = (ModelModel)presenter.Info;
                    _modelID       = model.ID;
                    View.NameModel = model.Name;
                }
            };
        }
コード例 #13
0
        protected override void SubscribeEvent()
        {
            View.Loading += View_Loading;

            View.Save += async() => await SaveAsync();

            View.SelectionPost += () =>
            {
                JournalsForm journal = new JournalsForm();

                JournalsPresenter <Post> presenter = new JournalsPresenter <Post>(journal, new PostJournal(journal.Grid));

                journal.ShowDialog();

                if (presenter.Info != null)
                {
                    PostModel post = (PostModel)presenter.Info;
                    _postID   = post.ID;
                    View.Post = post.Name;
                }
            };

            View.DeleteUser += DeleteUser;
        }