private async void BindAccountant(CrudAPI api, AccountantClient currentAccountant)
 {
     var acctant = await api.Query<AccountantClient>();
     cbAccountant.ItemsSource = acctant;
     grdAcctantDetail.DataContext = currentAccountant;
     if (currentAccountant != null)
         cbAccountant.SelectedItem = currentAccountant;
 }
        private async void GetAccountant()
        {
            var acc = await api.Query <AccountantClient>(new UnicontaBaseEntity[] { editrow }, null);

            if (acc != null && acc.Length > 0)
            {
                currentAccountant   = acc.FirstOrDefault();
                editrow._Accountant = currentAccountant.Id;
                txtaccountant.Text  = currentAccountant.Name;
            }
            else
            {
                editrow._Accountant = 0;
                txtaccountant.Text  = string.Empty;
                currentAccountant   = null;
            }
        }
        public AccountantAccess(CrudAPI api, AccountantClient accountant)
        {
            this.DataContext = this;
            InitializeComponent();
            currentAccountant = accountant;
            this.Title = Uniconta.ClientTools.Localization.lookup("Accountant");
#if SILVERLIGHT
            Utility.SetThemeBehaviorOnChildWindow(this);
#endif
            OKButton.Content = string.Format(Uniconta.ClientTools.Localization.lookup("AssignOBJ"), "");
            if (accountant != null)
                txtCurrentAccountant.Text = string.Concat("(", accountant.Name, ")");
            BindAccountant(api, accountant);
            accessAPI = new CompanyAccessAPI(api);
            lstAccess = new List<TasksAccess>();
            GetRights();
            this.Loaded += CW_Loaded;
        }