void crossCurrency2LookUpEdit_EditValueChanged(object sender, EventArgs e) { try { CurrentPriceFormat c = crossCurrency2LookUpEdit.GetSelectedDataRow() as CurrentPriceFormat; if (c != null) { crossCurrency2TextEdit.Text = c.Format; crossSymbol2TextEdit.Text = c.Symbol; } } catch (Exception ex) { Commons.Status(Commons.GetErrorCode("FSG", 15) + ex.Message); } }
void defaultCurrencyLookUpEdit_EditValueChanged(object sender, EventArgs e) { try { CurrentPriceFormat c = defaultCurrencyLookUpEdit.GetSelectedDataRow() as CurrentPriceFormat; if (c != null) { defaultCurrencyFormatTextEdit.Text = c.Format; defaultCurrencySymbolTextEdit.Text = c.Symbol; } } catch (Exception ex) { Commons.Status(Commons.GetErrorCode("FSG", 13) + ex.Message); } }
public Settings() { try { this.COMPANY_NAME = "COMPANY NAME"; this.COMPANY_DESC = "TİCARET VE SANAYİ LTD. ŞTİ."; this.HEADER_TITLE = "GENERAL SHIP SERVICE"; this.DESC_TR = "KUMANYA/MOTOR MALZ/KABYN MALZ/ELEKTRİK MALZ/GÜVENLİK MALZ/KİMYASALLAR/IMO SEMBOLLERİ"; this.DESC_EN = "PROVISION/ENGINE STORES/CABIN STORES/ELECTRICAL STORES/SAFETY EQUIPMENT/CHEMICALS/IMO SEMBOLS"; this.OFISPHONE = "+90 326 61X XX XX / +90 326 61X XX XX"; this.GSM = "+90 536 4XX 3X 2X / +90 532 7XX 8X 9X"; this.FAX = "+90 326 61X 5X 4X / TELEX: 3XXX1"; this.ADDRESS = "Çay Mah. Raifpaşa Cad. No: 18 İSKENDERUN/TÜRKİYE"; this.MAIL = "[email protected] / [email protected]"; this.WEB = "www.baymyo.com"; this.PREPAREDBY = "MUSTAFA YAŞAR ÖZKAN,GÖKHAN ODUNCU,EMRE SEÇER"; this.UNITS = "pcs,pck,box,tin,jar,kg,adet,ltr"; this.TEKLIF_VERME_FORMU = "FR: 08 - RV: 01"; this.MALZEME_TESLIM_FORMU = "FR: 29 - RV: 01"; this.SIPARIS_TOPLAMA_FORMU = "FR: 30 - RV: 00"; this.SIPARIS_LISTESI_FORMU = "FR: 32 - RV: 00"; this.URUN_KATALOG_FORMU = "FR: 33 - RV: 00"; this.HEADER_BACKCOLOR = Commons.RGBToString(System.Drawing.Color.Gainsboro); this.HEADER_BORDERCOLOR = Commons.RGBToString(System.Drawing.Color.Silver); this.HEADER_TITLECOLOR = this.HEADER_DESCCOLOR = "64,64,64"; this.COMPANY_FORECOLOR = this.DESC_TR_BACKCOLOR = "0,0,64"; this.DESC_EN_BACKCOLOR = Commons.RGBToString(System.Drawing.Color.Navy); this.DESC_TR_FORECOLOR = this.DESC_EN_FORECOLOR = Commons.RGBToString(System.Drawing.Color.White); this.DEFAULT_CURRENCY = CurrentPriceFormat.GetCurrency("TRY"); this.CROSS_CURRENCY_1 = CurrentPriceFormat.GetCurrency("USD"); this.CROSS_CURRENCY_2 = CurrentPriceFormat.GetCurrency("EUR"); this.IS_IMAGE_HEADER = false; this.DATABASE = Commons.FolderPath + "EasySupplyDatabase.mdb"; } catch (Exception ex) { Commons.Status(Commons.GetErrorCode("STG", 1) + ex.Message); } }
void GetSettings() { try { if (Commons.AppSettings == null) { Commons.AppSettings = new Settings(); } Commons.ColorLoad(); Commons.ImageLoad(); this.currentPriceFormatBindingSource.DataSource = CurrentPriceFormat.GetCurrencyFormats(); IsDatabase(); if (this.veritabaniOlusturButton.Enabled) { this.xtbSettings.SelectedTabPage = this.xtbDatabaseSettings; } CreateCode(); this.picHeader.Image = Commons.HeaderImage; this.picFatura.Image = Commons.HeaderFactura; this.picLogo.Image = Commons.LogoCompany; this.picOtherLogos.Image = Commons.LogoOther; this.imageFormHeaderCheck.Checked = Commons.AppSettings.IS_IMAGE_HEADER; this.txtTitle.Text = Commons.AppSettings.COMPANY_NAME; this.txtSubTitle.Text = Commons.AppSettings.COMPANY_DESC; this.txtHeaderLine.Text = Commons.AppSettings.HEADER_TITLE; this.txtDescTR.Text = Commons.AppSettings.DESC_TR; this.txtDescEN.Text = Commons.AppSettings.DESC_EN; this.txtOfficePhone.Text = Commons.AppSettings.OFISPHONE; this.txtGSM.Text = Commons.AppSettings.GSM; this.txtFAX.Text = Commons.AppSettings.FAX; this.txtAddress.Text = Commons.AppSettings.ADDRESS; this.txtMail.Text = Commons.AppSettings.MAIL; this.txtWeb.Text = Commons.AppSettings.WEB; this.txtPreparedBy.Text = Commons.AppSettings.PREPAREDBY; this.txtUnits.Text = Commons.AppSettings.UNITS; this.txtTeklifVerme.Text = Commons.AppSettings.TEKLIF_VERME_FORMU; this.txtMalzemeTeslimi.Text = Commons.AppSettings.MALZEME_TESLIM_FORMU; this.txtSiparisToplama.Text = Commons.AppSettings.SIPARIS_TOPLAMA_FORMU; this.txtSiparisFiyatListesi.Text = Commons.AppSettings.SIPARIS_LISTESI_FORMU; this.txtUrunKatalogForm.Text = Commons.AppSettings.URUN_KATALOG_FORMU; this.headerTitleBgColor.Color = Commons.HEADER_BACKCOLOR; this.headerTitleBrdColor.Color = Commons.HEADER_BORDERCOLOR; this.headerTitleFgColor.Color = Commons.HEADER_TITLECOLOR; this.headerDescColor.Color = Commons.HEADER_DESCCOLOR; this.companyForeColor.Color = Commons.COMPANY_FORECOLOR; this.descTRbackColor.Color = Commons.DESC_TR_BACKCOLOR; this.descTRforeColor.Color = Commons.DESC_TR_FORECOLOR; this.descENbackColor.Color = Commons.DESC_EN_BACKCOLOR; this.descENforeColor.Color = Commons.DESC_EN_FORECOLOR; this.defaultCurrencyLookUpEdit.EditValue = Commons.AppSettings.DEFAULT_CURRENCY.Code; this.defaultCurrencyFormatTextEdit.Text = Commons.AppSettings.DEFAULT_CURRENCY.Format; this.defaultCurrencySymbolTextEdit.Text = Commons.AppSettings.DEFAULT_CURRENCY.Symbol; this.crossCurrency1LookUpEdit.EditValue = Commons.AppSettings.CROSS_CURRENCY_1.Code; this.crossCurrency1TextEdit.Text = Commons.AppSettings.CROSS_CURRENCY_1.Format; this.crossSymbol1TextEdit.Text = Commons.AppSettings.CROSS_CURRENCY_1.Symbol; this.crossCurrency2LookUpEdit.EditValue = Commons.AppSettings.CROSS_CURRENCY_2.Code; this.crossCurrency2TextEdit.Text = Commons.AppSettings.CROSS_CURRENCY_2.Format; this.crossSymbol2TextEdit.Text = Commons.AppSettings.CROSS_CURRENCY_2.Symbol; this.networkDatabase.Text = Commons.AppSettings.DATABASE; } catch (Exception ex) { Commons.Status(Commons.GetErrorCode("FSG", 2) + ex.Message); } }
void savedButton_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(this.networkDatabase.Text)) { MessageBox.Show("Veritabanı ayarları boş bırakılamaz.", "Uyarı"); return; } Application.DoEvents(); Commons.Loading("Ayarlar bölümünde yaptığınız değişiklikler kaydediliyor.. ."); Commons.AppSettings.IS_IMAGE_HEADER = this.imageFormHeaderCheck.Checked; Commons.AppSettings.COMPANY_NAME = this.txtTitle.Text; Commons.AppSettings.COMPANY_DESC = this.txtSubTitle.Text; Commons.AppSettings.HEADER_TITLE = this.txtHeaderLine.Text; Commons.AppSettings.DESC_TR = this.txtDescTR.Text; Commons.AppSettings.DESC_EN = this.txtDescEN.Text; Commons.AppSettings.OFISPHONE = this.txtOfficePhone.Text; Commons.AppSettings.GSM = this.txtGSM.Text; Commons.AppSettings.FAX = this.txtFAX.Text; Commons.AppSettings.ADDRESS = this.txtAddress.Text; Commons.AppSettings.MAIL = this.txtMail.Text; Commons.AppSettings.WEB = this.txtWeb.Text; Commons.AppSettings.PREPAREDBY = this.txtPreparedBy.Text.Trim().ToUpper(); Commons.AppSettings.UNITS = this.txtUnits.Text.Trim(); Commons.AppSettings.TEKLIF_VERME_FORMU = this.txtTeklifVerme.Text; Commons.AppSettings.MALZEME_TESLIM_FORMU = this.txtMalzemeTeslimi.Text; Commons.AppSettings.SIPARIS_TOPLAMA_FORMU = this.txtSiparisToplama.Text; Commons.AppSettings.SIPARIS_LISTESI_FORMU = this.txtSiparisFiyatListesi.Text; Commons.AppSettings.URUN_KATALOG_FORMU = this.txtUrunKatalogForm.Text; Commons.AppSettings.HEADER_BACKCOLOR = Commons.RGBToString(this.headerTitleBgColor.Color); Commons.AppSettings.HEADER_BORDERCOLOR = Commons.RGBToString(this.headerTitleBrdColor.Color); Commons.AppSettings.HEADER_TITLECOLOR = Commons.RGBToString(this.headerTitleFgColor.Color); Commons.AppSettings.HEADER_DESCCOLOR = Commons.RGBToString(this.headerDescColor.Color); Commons.AppSettings.COMPANY_FORECOLOR = Commons.RGBToString(this.companyForeColor.Color); Commons.AppSettings.DESC_TR_BACKCOLOR = Commons.RGBToString(this.descTRbackColor.Color); Commons.AppSettings.DESC_TR_FORECOLOR = Commons.RGBToString(this.descTRforeColor.Color); Commons.AppSettings.DESC_EN_BACKCOLOR = Commons.RGBToString(this.descENbackColor.Color); Commons.AppSettings.DESC_EN_FORECOLOR = Commons.RGBToString(this.descENforeColor.Color); if (this.currencyCheck.Checked) { CurrentPriceFormat c = this.defaultCurrencyLookUpEdit.GetSelectedDataRow() as CurrentPriceFormat; CurrentPriceFormat c1 = this.crossCurrency1LookUpEdit.GetSelectedDataRow() as CurrentPriceFormat; CurrentPriceFormat c2 = this.crossCurrency2LookUpEdit.GetSelectedDataRow() as CurrentPriceFormat; if (c.Code.Equals(c1.Code) || c.Code.Equals(c2.Code)) { dxErrorProvider1.SetError(defaultCurrencyLookUpEdit, L.DovizKuruBelirtilmis); return; } else if (c1.Code.Equals(c.Code) || c1.Code.Equals(c2.Code)) { dxErrorProvider1.SetError(crossCurrency1LookUpEdit, L.DovizKuruBelirtilmis); return; } else if (c2.Code.Equals(c.Code) || c2.Code.Equals(c1.Code)) { dxErrorProvider1.SetError(crossCurrency2LookUpEdit, L.DovizKuruBelirtilmis); return; } else { Commons.AppSettings.DEFAULT_CURRENCY = c; if (!string.IsNullOrWhiteSpace(this.defaultCurrencyFormatTextEdit.Text)) { Commons.AppSettings.DEFAULT_CURRENCY.Format = this.defaultCurrencyFormatTextEdit.Text; } if (!string.IsNullOrWhiteSpace(this.defaultCurrencySymbolTextEdit.Text)) { Commons.AppSettings.DEFAULT_CURRENCY.Symbol = this.defaultCurrencySymbolTextEdit.Text; } Commons.AppSettings.CROSS_CURRENCY_1 = c1; if (!string.IsNullOrWhiteSpace(this.crossCurrency1TextEdit.Text)) { Commons.AppSettings.CROSS_CURRENCY_1.Format = this.crossCurrency1TextEdit.Text; } if (!string.IsNullOrWhiteSpace(this.crossSymbol1TextEdit.Text)) { Commons.AppSettings.CROSS_CURRENCY_1.Symbol = this.crossSymbol1TextEdit.Text; } Commons.AppSettings.CROSS_CURRENCY_2 = c2; if (!string.IsNullOrWhiteSpace(this.crossCurrency2TextEdit.Text)) { Commons.AppSettings.CROSS_CURRENCY_2.Format = this.crossCurrency2TextEdit.Text; } if (!string.IsNullOrWhiteSpace(this.crossSymbol2TextEdit.Text)) { Commons.AppSettings.CROSS_CURRENCY_2.Symbol = this.crossSymbol2TextEdit.Text; } } } dxErrorProvider1.ClearErrors(); Commons.AppSettings.DATABASE = this.networkDatabase.Text; if (!Commons.ConnectionStates()) { Commons.Loaded(); MessageBox.Show("Lütfen veritabanı bilgilerinin doğru olduğundan emin olunuz bu ayarı doğru yapmadığınız sürece bilgilerinize erişim sağlayamazsınız!", "Önemli Uyarı"); return; } if (jSonData.CreateFile(Commons.AppSettings)) { Commons.ColorLoad(); Commons.Loaded(); MessageBox.Show("Ayarlarınız başarılı bir şekilde kaydedildi.", "Bilgi"); this.DialogResult = DialogResult.OK; } } catch (Exception ex) { Commons.Status(Commons.GetErrorCode("FSG", 9) + ex.Message); Commons.Loaded(); } }