Esempio n. 1
0
        private void btnApplySettings_Click(object sender, EventArgs e)
        {
            try
            {
                //Apply General Settings to CommonFunctions Module
                CommonFunctions.ObjGeneralSettings.SummaryLocation = ddlSummaryLocation.SelectedIndex;

                //Apply Invoice Settings to CommonFunctions Module
                ReportSettings CurrSettings = CommonFunctions.ObjInvoiceSettings;
                CurrSettings.HeaderTitle         = txtBoxHeaderTitleInv.Text;
                CurrSettings.HeaderSubTitle      = txtBoxHeaderSubTitleInv.Text;
                CurrSettings.HeaderTitleColor    = txtBoxHeaderTitleColorInv.BackColor;
                CurrSettings.HeaderSubTitleColor = txtBoxHeaderSubTitleColorInv.BackColor;
                CurrSettings.FooterTitle         = txtBoxFooterTitleInv.Text;
                CurrSettings.FooterTitleColor    = txtBoxFooterTitleColorInv.BackColor;
                CurrSettings.FooterTextColor     = txtBoxFooterTextColorInv.BackColor;
                CurrSettings.Address             = txtBoxAddressInv.Text;
                CurrSettings.PhoneNumber         = txtBoxPhoneNumberInv.Text;
                CurrSettings.EMailID             = txtBoxEMailIDInv.Text;
                CurrSettings.VATPercent          = txtBoxVATPercentInv.Text;
                CurrSettings.TINNumber           = txtBoxTINNumberInv.Text;
                CurrSettings.GSTINumber          = txtBoxGSTINumberInv.Text;
                CurrSettings.LastNumber          = Int32.Parse(txtBoxLastInvoiceNumberInv.Text);

                //Apply Quotation Settings to CommonFunctions Module
                CurrSettings                     = CommonFunctions.ObjQuotationSettings;
                CurrSettings.HeaderTitle         = txtBoxHeaderTitleQuot.Text;
                CurrSettings.HeaderSubTitle      = txtBoxHeaderSubTitleQuot.Text;
                CurrSettings.HeaderTitleColor    = txtBoxHeaderTitleColorQuot.BackColor;
                CurrSettings.HeaderSubTitleColor = txtBoxHeaderSubTitleColorQuot.BackColor;
                CurrSettings.FooterTitle         = txtBoxFooterTitleQuot.Text;
                CurrSettings.FooterTitleColor    = txtBoxFooterTitleColorQuot.BackColor;
                CurrSettings.FooterTextColor     = txtBoxFooterTextColorQuot.BackColor;
                CurrSettings.Address             = txtBoxAddressQuot.Text;
                CurrSettings.PhoneNumber         = txtBoxPhoneNumberQuot.Text;
                CurrSettings.EMailID             = txtBoxEMailIDQuot.Text;
                CurrSettings.TINNumber           = txtBoxTINNumberQuot.Text;
                CurrSettings.GSTINumber          = txtBoxGSTINumberQuot.Text;
                CurrSettings.LastNumber          = Int32.Parse(txtBoxLastQuotationNumberQuot.Text);

                //Apply Purchase Order Settings to CommonFunctions Module
                CurrSettings                     = CommonFunctions.ObjPurchaseOrderSettings;
                CurrSettings.HeaderTitle         = txtBoxHeaderTitlePO.Text;
                CurrSettings.HeaderSubTitle      = txtBoxHeaderSubTitlePO.Text;
                CurrSettings.HeaderTitleColor    = txtBoxHeaderTitleColorPO.BackColor;
                CurrSettings.HeaderSubTitleColor = txtBoxHeaderSubTitleColorPO.BackColor;
                CurrSettings.FooterTitle         = txtBoxFooterTitlePO.Text;
                CurrSettings.FooterTitleColor    = txtBoxFooterTitleColorPO.BackColor;
                CurrSettings.FooterTextColor     = txtBoxFooterTextColorPO.BackColor;
                CurrSettings.Address             = txtBoxAddressPO.Text;
                CurrSettings.PhoneNumber         = txtBoxPhoneNumberPO.Text;
                CurrSettings.EMailID             = txtBoxEMailIDPO.Text;
                CurrSettings.VATPercent          = txtBoxVATPercentPO.Text;
                CurrSettings.TINNumber           = txtBoxTINNumberPO.Text;
                CurrSettings.GSTINumber          = txtBoxGSTINumberPO.Text;
                CurrSettings.LastNumber          = Int32.Parse(txtBoxLastPONumber.Text);
                CurrSettings.PastSalePeriodValue = (Int32)numUpDownPeriodValue.Value;
                CurrSettings.PastSalePeriodUnits = ReportSettings.GetTimePeriodUnits(cmbBoxPeriodUnits.SelectedItem.ToString());

                CommonFunctions.WriteToSettingsFile();      //Save to Settings.xml file

                MessageBox.Show(this, "Settings Updated Successfully", "Settings", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            catch (Exception ex)
            {
                CommonFunctions.ShowErrorDialog("SettingsForm.btnApplySettings_Click", ex);
                throw;
            }
        }
Esempio n. 2
0
 private void VendorPurchaseOrderForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     CommonFunctions.WriteToSettingsFile();
 }
Esempio n. 3
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     CommonFunctions.WriteToSettingsFile();
 }