Example #1
0
        private void LoadCurrentProfile()
        {
            if (profile == null)
            {
                profile = da.getProfileCurrent();
            }
            profile.DefaultIncomeCurrencyCode = profile.DefaultIncomeCurrencyCode.Replace(" ", String.Empty);
            edtAddress.Text = profile.AddressFact;
            edtName.Text = profile.CompanyName;

            //edtDefaultIsCashless.IsChecked = profile.DefaultIsCashless == 1 ? true : false;
            edtUNN.Text = profile.UNN;
            LoadCurrencies();
            CurrencyCodeOld = edtBasicCurrency.SelectedItem.ToString();
            CurrencyCodeOld_IncomeDef = profile.DefaultIncomeCurrencyCode;
            edtDefaultIncomeCurrency.SelectedItem = profile.DefaultIncomeCurrencyCode;

            edtAccountant.Text = profile.SeniorAccountant;
            edtCompanyHead.Text = profile.CompanyHead;
            edtJAddress.Text = profile.AddressJur;
            edtLoadPoint.Text = profile.LoadPoint;
            edtOKPO.Text = profile.OKPO;

            edtDefaultSearchField.SelectedIndex = profile.DefSearchFieldIndex.HasValue ? profile.DefSearchFieldIndex.Value : 0;
            edtSearchTypeInMainWindow.SelectedIndex = profile.UseScanner.HasValue ? profile.UseScanner.Value : 0;

            //edtBankAccount.Text = profile.BankAccount;
            // edtBankAddress.Text = profile.BankAddress;
            // edtBankMFO.Text = profile.BankMFO;
            // edtBankName.Text = profile.BankName;
        }
Example #2
0
 /// <summary>
 /// Create a new settings_profile object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="companyName">Initial value of the CompanyName property.</param>
 /// <param name="defaultUserID">Initial value of the DefaultUserID property.</param>
 public static settings_profile Createsettings_profile(global::System.Int32 id, global::System.String companyName, global::System.Int32 defaultUserID)
 {
     settings_profile settings_profile = new settings_profile();
     settings_profile.id = id;
     settings_profile.CompanyName = companyName;
     settings_profile.DefaultUserID = defaultUserID;
     return settings_profile;
 }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the settings_profile EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTosettings_profile(settings_profile settings_profile)
 {
     base.AddObject("settings_profile", settings_profile);
 }
Example #4
0
        public int ProfileEdit(settings_profile p)
        {
            settings_profile o = objDataContext.settings_profile.FirstOrDefault(i => i.id == p.id);
            o.AddressFact = p.AddressFact;
            o.AddressJur = p.AddressJur;
            o.BasicCurrencyCode = p.BasicCurrencyCode;
            o.CompanyHead = p.CompanyHead;
            o.CompanyName = p.CompanyName;
            o.DefaultIncomeCurrencyCode = p.DefaultIncomeCurrencyCode;
            o.DefaultIsCashless = p.DefaultIsCashless;

            //o.IsCurrent = p.IsCurrent;
            o.LoadPoint = p.LoadPoint;
            o.OKPO = p.OKPO;
            o.SeniorAccountant = p.SeniorAccountant;
            o.UNN = p.UNN;
            o.DefSearchFieldIndex = p.DefSearchFieldIndex;
            o.UseScanner = p.UseScanner;
            o.SimpleInput = p.SimpleInput;
            objDataContext.SaveChanges();
            return o.id;
        }
Example #5
0
 public int ProfileCreate(settings_profile profile)
 {
     objDataContext.AddTosettings_profile(profile);
     return profile.id;
 }
Example #6
0
 public settings_profile getProfileCurrent()
 {
     if (objDataContext.settings_profile.Count() == 0)
     {
         settings_profile p = new settings_profile();
         p.AddressFact = "";
         p.AddressJur = "";
         p.BasicCurrencyCode = "BYR";
         p.CompanyHead = "";
         p.CompanyName = "";
         p.DefaultIncomeCurrencyCode = "BYR";
         p.DefaultIsCashless = 0;
         p.DefSearchFieldIndex = 0;
         p.IsCurrent = 1;
         p.LoadPoint = "";
         p.OKPO = "";
         p.SeniorAccountant = "";
         p.UNN = "";
         p.UseScanner = 0;
         objDataContext.AddTosettings_profile(p);
         objDataContext.SaveChanges();
     }
     return objDataContext.settings_profile.FirstOrDefault(i => i.IsCurrent == 1);
 }