Exemplo n.º 1
0
        private void SettingPage_Load(object sender, EventArgs e)
        {
            using (var baseInfo = new BaseInfoDetailsRepository())
            {
                cmbLanguage.DataSource    = baseInfo.GetBaseInfoDetailsByGroupId(3);
                cmbLanguage.ValueMember   = "Id";
                cmbLanguage.DisplayMember = "Name";

                cmbDateFormat.DataSource    = baseInfo.GetBaseInfoDetailsByGroupId(4);
                cmbDateFormat.ValueMember   = "Id";
                cmbDateFormat.DisplayMember = "Text";

                //Language Default Records = (Persian-5)_(Arabic=6)_(Kurdish=7)

                if (!string.IsNullOrEmpty(Settings.Default.Language))
                {
                    var a = Settings.Default.Language;
                    cmbLanguage.SelectedValue = int.Parse(Settings.Default.Language == "ku-Arab-IR" ? "6" : "5");
                }
                else
                {
                    Settings.Default.Language = "5";
                    Settings.Default.Save();
                }

                //Format Date Default Records = (Shamsi-8)_(Miladi=9)
                if (!string.IsNullOrEmpty(Settings.Default.FormatDate))
                {
                    cmbDateFormat.SelectedValue = int.Parse(Settings.Default.FormatDate);
                }
                else
                {
                    Settings.Default.FormatDate = "8";
                    Settings.Default.Save();
                }
            }
        }
Exemplo n.º 2
0
        private void FillLists()
        {
            using (var context = new BaseInfoDetailsRepository())
            {
                //Nationality
                cmbNationality.DataSource  = context.GetBaseInfoDetailsByGroupId(5);
                cmbNationality.ValueMember = "Id";
                ;
                cmbNationality.DisplayMember = "Text";
            }

            using (var dbContext = new UnitOfWork())
            {
                //Banks
                cmbBank.DataSource  = dbContext.BankAccountRepository.GetAll();
                cmbBank.ValueMember = "Id";
                ;
                cmbBank.DisplayMember = "BankName";
            }
        }