예제 #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;
        }
        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);
            }
        }
        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;
            }
        }
        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;
            }
        }
        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;
            }
        }
        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;
        }
        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);
            }
        }
        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;
        }