コード例 #1
0
        void InitPage(CrudAPI crudapi)
        {
            BusyIndicator        = busyIndicator;
            dAddress.Header      = Uniconta.ClientTools.Localization.lookup("DeliveryAddr");
            layoutControl        = layoutItems;
            lePostingAccount.api = Employeelookupeditor.api = leAccount.api = lePayment.api = cmbDim1.api
                                                                                                  = leTransType.api = cmbDim2.api = cmbDim3.api = cmbDim4.api = cmbDim5.api = leGroup.api = leShipment.api =
                                                                                                        PrCategorylookupeditor.api     = Projectlookupeditor.api = leApprover.api = leDeliveryTerm.api = leInvoiceAccount.api =
                                                                                                            PriceListlookupeditior.api = leLayoutGroup.api = leVat.api = prTasklookupeditor.api = crudapi;

#if SILVERLIGHT
            leRelatedOrder.api = crudapi;
#else
            leRelatedOrder.CrudApi = crudapi;
#endif

            cbDeliveryCountry.ItemsSource = Enum.GetValues(typeof(Uniconta.Common.CountryCode));
            if (editrow == null)
            {
                frmRibbon.DisableButtons("Delete");
                liCreatedTime.Visibility = Visibility.Collapsed;
                editrow          = CreateNew() as CreditorOrderClient;
                editrow._Created = DateTime.MinValue;
                if (Creditor != null)
                {
                    editrow.SetMaster(this.Creditor);
                    if (editrow.RowId == 0)
                    {
                        SetValuesFromMaster(this.Creditor);
                    }
                    leAccount.IsEnabled = txtName.IsEnabled = false;
                }
                if (Contact != null)
                {
                    editrow.SetMaster(Contact);
                    leAccount.IsEnabled = txtName.IsEnabled = cmbContactName.IsEnabled = false;
                }
            }
            else
            {
                BindContact(editrow.Creditor);
            }
            AdjustLayout();

            layoutItems.DataContext  = editrow;
            frmRibbon.OnItemClicked += frmRibbon_OnItemClicked;

            AcItem.ButtonClicked += AcItem_ButtonClicked;
#if !SILVERLIGHT
            editrow.PropertyChanged += Editrow_PropertyChanged;
#endif
            if (crudapi.GetCache(typeof(Uniconta.DataModel.Creditor)) == null)
            {
                crudapi.LoadCache(typeof(Uniconta.DataModel.Creditor));
            }
        }
コード例 #2
0
 public override void RowsPastedDone()
 {
     if (Creditor != null)
     {
         editrow.SetMaster(Creditor);
     }
     if (Contact != null)
     {
         editrow.SetMaster(Contact);
     }
     SetValuesFromMaster(Creditor);
 }
コード例 #3
0
        void leAccount_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
        {
            if (readingOIOUBL)
            {
                return;
            }
            string id     = Convert.ToString(e.NewValue);
            var    crdtor = (Uniconta.DataModel.Creditor)creditors?.Get(id);

            if (crdtor != null)
            {
                Order.SetMaster(crdtor);
                Order.DeliveryName     = crdtor._DeliveryName;
                Order.DeliveryAddress1 = crdtor._DeliveryAddress1;
                Order.DeliveryAddress2 = crdtor._DeliveryAddress2;
                Order.DeliveryAddress3 = crdtor._DeliveryAddress3;
                Order.DeliveryCity     = crdtor._DeliveryCity;
                Order.DeliveryZipCode  = crdtor._DeliveryZipCode;
                if (crdtor._DeliveryCountry != 0)
                {
                    Order.DeliveryCountry = crdtor._DeliveryCountry;
                }
                hasEmail = crdtor._InvoiceEmail != null || crdtor._EmailDocuments;
                if (OrderCurrency != 0 && OrderCurrency != CompCurrency)
                {
                    loadExchange();
                }
                this.DataContext = null;
                this.DataContext = Order;
                IEnumerable <DCOrderLineClient> lines = (IEnumerable <DCOrderLineClient>)dgCreditorOrderLineGrid.ItemsSource;
                lines?.FirstOrDefault()?.SetMaster(Order);
                PriceLookup?.OrderChanged(Order);
                api.Read(crdtor);
            }
        }
コード例 #4
0
        private void InitPage()
        {
            InitializeComponent();
            var Comp = api.CompanyEntity;

            CompCurrency = (byte)Comp._CurrencyId;

            ((TableView)dgCreditorOrderLineGrid.View).RowStyle = Application.Current.Resources["StyleRow"] as Style;
            ledim1.api        = ledim2.api = ledim3.api = ledim4.api = ledim5.api = LeAccount.api =
                lePayment.api = leTransType.api = LePostingAccount.api = leShipment.api = leDeliveryTerm.api =
                    Projectlookupeditor.api = PrCategorylookupeditor.api = employeelookupeditor.api = api;

            initialOrder = new CreditorOrderClient();
            initialOrder._DeliveryCountry = Comp._CountryId;
            initialOrder.SetMaster(Comp);

            setDimensions();
            cbDeliveryCountry.ItemsSource = Enum.GetValues(typeof(Uniconta.Common.CountryCode));
            SetRibbonControl(localMenu, dgCreditorOrderLineGrid);
            dgCreditorOrderLineGrid.api           = api;
            dgCreditorOrderLineGrid.BusyIndicator = busyIndicator;
            localMenu.OnItemClicked += localMenu_OnItemClicked;
            dgCreditorOrderLineGrid.View.DataControl.CurrentItemChanged += DataControl_CurrentItemChanged;
#if !SILVERLIGHT
            btnAccount.ToolTip = string.Format(Uniconta.ClientTools.Localization.lookup("CreateOBJ"), Uniconta.ClientTools.Localization.lookup("Creditor"));
#endif
            txtName.IsEnabled = false;
            dgCreditorOrderLineGrid.Visibility = Visibility.Visible;
            ShowCustomCloseConfiramtion        = true;

            // we setup first order
            ClearFields(initialOrder);

            if (dgCreditorOrderLineGrid.IsLoadedFromLayoutSaved)
            {
                dgCreditorOrderLineGrid.ClearSorting();
                dgCreditorOrderLineGrid.IsLoadedFromLayoutSaved = false;
            }

            this.creditors = Comp.GetCache(typeof(Uniconta.DataModel.Creditor));
            this.items     = Comp.GetCache(typeof(InvItem));
            if (Comp.Warehouse)
            {
                this.warehouse = Comp.GetCache(typeof(InvWarehouse));
            }
            if (Comp.ItemVariants)
            {
                this.variants1        = Comp.GetCache(typeof(InvVariant1));
                this.variants2        = Comp.GetCache(typeof(InvVariant2));
                this.standardVariants = Comp.GetCache(typeof(InvStandardVariant));
            }
            RemoveMenuItem();
            dgCreditorOrderLineGrid.allowSave = false;
#if SILVERLIGHT
            Application.Current.RootVisual.KeyDown += Page_KeyDown;
#else
            this.KeyDown += Page_KeyDown;
#endif
        }