Exemplo n.º 1
0
        public bool SaveData()
        {
            bool isValid = true;

            float sales  = 0;
            float profit = 0;

            if (float.TryParse(txtSalesPlan.Text.Replace(" ", ""), out sales) && sales > 0 && float.TryParse(txtProfitPlan.Text.Replace(" ", ""), out profit) && profit > 0)
            {
                OrderStatisticsService.SetProfitPlan(sales, profit);
            }
            else
            {
                ErrMessage += Resource.Admin_CommonSettings_ProfitError;
                isValid     = false;
            }

            LoadData();
            return(isValid);
        }
Exemplo n.º 2
0
        public new void SaveData()
        {
            float sales;
            float profit;

            StringHelper.GetMoneyFromString(txtPlan.Text, out sales);
            StringHelper.GetMoneyFromString(txtPlaPribl.Text, out profit);
            OrderStatisticsService.SetProfitPlan(sales, profit);

            SettingsOrderConfirmation.AmountLimitation = chbCheakProductCount.Checked;

            float minimalOrderPrice;
            float minimalPriceCertificate;
            float maximalPriceCertificate;

            StringHelper.GetMoneyFromString(txtMinOrderPrice.Text, out minimalOrderPrice);
            SettingsOrderConfirmation.MinimalOrderPrice = minimalOrderPrice;

            StringHelper.GetMoneyFromString(txtMinPriceGift.Text, out minimalPriceCertificate);
            SettingsOrderConfirmation.MinimalPriceCertificate = minimalPriceCertificate;

            StringHelper.GetMoneyFromString(txtMaxPriceGift.Text, out maximalPriceCertificate);
            SettingsOrderConfirmation.MaximalPriceCertificate = maximalPriceCertificate;

            SettingsBank.Address     = txtCompanyAddress.Text;
            SettingsBank.CompanyName = txtCompanyName.Text;
            SettingsBank.INN         = txtInn.Text;
            SettingsBank.KPP         = txtKPP.Text;
            SettingsBank.RS          = txtRachetniChet.Text;
            SettingsBank.BankName    = txtBankName.Text;
            SettingsBank.KS          = txtKorrecpChet.Text;
            SettingsBank.BIK         = txtBik.Text;

            if (fuPechat.HasFile)
            {
                FileHelpers.CreateDirectory(FoldersHelper.GetPathAbsolut(FolderType.Pictures));
                FileHelpers.DeleteFile(FoldersHelper.GetPathAbsolut(FolderType.Pictures, SettingsBank.StampImageName));
                SettingsBank.StampImageName = fuPechat.FileName;
                fuPechat.SaveAs(FoldersHelper.GetPathAbsolut(FolderType.Pictures, fuPechat.FileName));
            }
        }