Beispiel #1
0
        private void GenerateNewPanels()
        {
            for (int i = 0; i < temporaryDepartments.Count; i++)
            {
                DepartmentSettingPanel panel = null;
                if (temporaryDepartments[i] is ProcessingDepartment)
                {
                    ProcessingDepartment pDp = (ProcessingDepartment)temporaryDepartments[i];

                    //Keep the higher sorter set the same
                    if (pDp.SortsHigherWeights)
                    {
                        panel = new DepartmentSettingPanel(
                            pDp, this, DepartmentSettingPanel.SettingPanelType.highestProcessingDp);
                    }
                    else
                    {
                        panel = new DepartmentSettingPanel(
                            pDp, this, DepartmentSettingPanel.SettingPanelType.ProcessingDp);
                    }
                }

                //Set the insurance panel
                if (temporaryDepartments[i] is InsuranceDepartment)
                {
                    InsuranceDepartment iDp = (InsuranceDepartment)temporaryDepartments[i];
                    panel = new DepartmentSettingPanel(
                        iDp, this, DepartmentSettingPanel.SettingPanelType.InsuranceDp);
                }
                DSPanels.Add(panel);
            }
        }
Beispiel #2
0
 private void WeightNumericBox_ValueChanged(object sender, EventArgs e)
 {
     if (dep is ProcessingDepartment)
     {
         ProcessingDepartment pD = (ProcessingDepartment)dep;
         pD.SetWeight((int)WeightNumericBox.Value);
         dep = pD;
     }
     else if (dep is InsuranceDepartment)
     {
         InsuranceDepartment iD = (InsuranceDepartment)dep;
         iD.setSigningPrice((float)WeightNumericBox.Value);
         dep = iD;
     }
 }
Beispiel #3
0
        public DepartmentSettingPanel(Department dep, SettingsScreen settingsScreen, SettingPanelType type)
        {
            InitializeComponent();
            this.dep            = dep;
            this.settingsScreen = settingsScreen;
            panelType           = type;

            NameTextBox.Text = dep.Name;
            if (dep is ProcessingDepartment)
            {
                ProcessingDepartment pD = (ProcessingDepartment)dep;
                depWeightClass         = pD.WeightClass;
                WeightNumericBox.Value = (decimal)depWeightClass;
            }
            else if (dep is InsuranceDepartment)
            {
                InsuranceDepartment iD = (InsuranceDepartment)dep;
                depPriceInsuranceClass = iD.MinSigningPrice;
                WeightNumericBox.Value = (decimal)depPriceInsuranceClass;
            }
            SetTypeChanges();
        }
Beispiel #4
0
        private void SetValues(Parcel parcel)
        {
            WeightLabel.Text = parcel.Weight + WeightText;
            ValueLabel.Text  = parcel.Value + ValueText;
            InsuranceDepartment iDp = ObjectInstances.departments.GetInsuranceDepartment();

            if (parcel.Value > iDp.MinSigningPrice)
            {
                bool signButtonOn = !parcel.IsSignedOff();
                if (signButtonOn)
                {
                    ButtonInsuranceSignOff.Visible = signButtonOn;
                    ButtonInsuranceSignOff.Click  +=
                        delegate(object sender, EventArgs e) {
                        parcel.SignOffInsurance();
                        mainScreen.RefreshListItems();
                    };
                }
                else
                {
                    ValueLabel.Text += InsurenceSignedText;
                }
            }
        }
Beispiel #5
0
 public InsuranceDepartmentTest()
 {
     _mailDepartment = new InsuranceDepartment();
 }