private void btnOptions_Click(object sender, RoutedEventArgs e)
        {
            switch (editrow.PaymentMethod)
            {
            case DebtorPaymFormatType.Iceland:
                CWDebtorPaymentSetupIceland dialogIceland = new CWDebtorPaymentSetupIceland(this.api, editrow);
                dialogIceland.Closing += delegate
                {
                    if (dialogIceland.DialogResult == true)
                    {
                        StreamingManager.Copy(dialogIceland.paymentFormatIceland, editrow);
                    }
                };
                dialogIceland.Show();
                break;

#if !SILVERLIGHT
            case DebtorPaymFormatType.NetsBS:
                CWDebtorPaymentSetupNets dialogNets = new CWDebtorPaymentSetupNets(this.api, editrow);
                dialogNets.Closing += delegate
                {
                    if (dialogNets.DialogResult == true)
                    {
                        StreamingManager.Copy(dialogNets.paymentFormatNets, editrow);
                    }
                };
                dialogNets.Show();
                break;
#endif
            default:
                UnicontaMessageBox.Show(Uniconta.ClientTools.Localization.lookup("NoOptions"), Uniconta.ClientTools.Localization.lookup("Warning"));
                break;
            }
        }
Ejemplo n.º 2
0
        public BankSpecificSettingsLT(CreditorPaymentFormat credPaymFormat)
        {
            CreditorPaymentFormatClientISOLT credPaymFormatISOLT = new CreditorPaymentFormatClientISOLT();

            StreamingManager.Copy(credPaymFormat, credPaymFormatISOLT);
            CredPaymFormat = credPaymFormatISOLT;
        }
        public BankSpecificSettingsSE(CreditorPaymentFormat credPaymFormat)
        {
            CreditorPaymentFormatClientISOSE credPaymFormatISOSE = new CreditorPaymentFormatClientISOSE();

            StreamingManager.Copy(credPaymFormat, credPaymFormatISOSE);
            CredPaymFormat = credPaymFormatISOSE;
        }
 void insertOrUpdateAccount(string account, GLClosingSheetLineLocal lin, GLClosingSheetLineLocal clone)
 {
     if (account != null && account != masterAccount._Account)
     {
         var acc = FindAccount(account);
         if (acc != null)
         {
             var accLines = acc.Lines;
             if (accLines == null)
             {
                 acc.Lines = new List <GLClosingSheetLineLocal>()
                 {
                     clone
                 }
             }
             ;
             else
             {
                 var linOffset = FindLine(accLines, lin.RowId);
                 if (linOffset == null)
                 {
                     ((List <GLClosingSheetLineLocal>)accLines).Add(clone);
                 }
                 else
                 {
                     StreamingManager.Copy(lin, linOffset);
                 }
             }
             SumLines(acc);
         }
     }
 }
        public BankSpecificSettingsNO(CreditorPaymentFormat credPaymFormat)
        {
            CreditorPaymentFormatClientISONO credPaymFormatISONO = new CreditorPaymentFormatClientISONO();

            StreamingManager.Copy(credPaymFormat, credPaymFormatISONO);
            CredPaymFormat = credPaymFormatISONO;
        }
Ejemplo n.º 6
0
        public BankSpecificSettingsCH(CreditorPaymentFormat credPaymFormat)
        {
            CreditorPaymentFormatClientISOCH credPaymFormatISOCH = new CreditorPaymentFormatClientISOCH();

            StreamingManager.Copy(credPaymFormat, credPaymFormatISOCH);
            CredPaymFormat = credPaymFormatISOCH;
        }
Ejemplo n.º 7
0
        async private Task <DebtorCollectionReportClient> GenerateStandardCollectionReport(CompanyClient companyClient, DateTime dueDate, DebtorPaymentStatementList selectedItem, byte[] logo, DebtorEmailType debtorEmailType)
        {
            var dbClientTotal = selectedItem.ChildRecords.FirstOrDefault();
            var debtorType    = Uniconta.Reports.Utilities.ReportUtil.GetUserType(typeof(DebtorClient), api.CompanyEntity);
            var debtorClient  = Activator.CreateInstance(debtorType) as DebtorClient;

            StreamingManager.Copy(dbClientTotal.Debtor, debtorClient);

            var lan = UtilDisplay.GetLanguage(debtorClient, companyClient);

            if (lastMessage == null || messageLanguage != lan)
            {
                messageLanguage = lan;
                var res = await Utility.GetDebtorMessageClient(api, lan, debtorEmailType);

                if (res != null)
                {
                    lastMessage = res._Text;
                }
                else
                {
                    lastMessage = string.Empty;
                }
            }

            debtorClient.OpenTransactions = selectedItem.ChildRecords.ToArray();
            string _reportName = StandardReportUtility.GetLocalizedReportName(debtorClient, companyClient, debtorEmailType.ToString());

            return(new DebtorCollectionReportClient(companyClient, debtorClient, dueDate, logo, this.AddInterest, _reportName, lastMessage));
        }
Ejemplo n.º 8
0
        public BankSpecificSettingsNL(CreditorPaymentFormat credPaymFormat)
        {
            CreditorPaymentFormatClientISONL credPaymFormatISONL = new CreditorPaymentFormatClientISONL();

            StreamingManager.Copy(credPaymFormat, credPaymFormatISONL);
            CredPaymFormat = credPaymFormatISONL;
        }
        void BindClosingSheet(GLAccountClosingSheetClient acc)
        {
            if (acc != null)
            {
                this.primo         = acc.OrgBalance;
                this.masterAccount = acc;
                var Account = acc._Account;
                dgClosingSheetLine.MasterAccount = Account;

                List <GLClosingSheetLineLocal> lst = new List <GLClosingSheetLineLocal>();
                if (acc.Lines != null)
                {
                    foreach (var l in acc.Lines)
                    {
                        var lin = new GLClosingSheetLineLocal();
                        StreamingManager.Copy(l, lin);
                        lst.Add(lin);
                        lin.Swap = (lin._OffsetAccount == Account);
                    }
                }
                dgClosingSheetLine.ItemsSource = lst;
                dgClosingSheetLine.SelectRange(0, 0);
                dgClosingSheetLine.Visibility = Visibility.Visible;
            }
        }
Ejemplo n.º 10
0
        async private Task PrintDebtorPaymentStatementPage(CompanyClient companyClient, byte[] logo, DebtorPaymentStatementList selectedItem, string emailType)
        {
            int indexDebtorEmailType = AppEnums.DebtorEmailType.IndexOf(emailType);
            var debtorEmailType      = (DebtorEmailType)indexDebtorEmailType;

            var dbClientTotal = selectedItem.ChildRecords.FirstOrDefault();

            if (dbClientTotal != null)
            {
                var debtorClient = new DebtorClient();
                StreamingManager.Copy(dbClientTotal.Debtor, debtorClient);

                var debtorMessageClient = await Utility.GetDebtorMessageClient(api, debtorClient._Language, debtorEmailType);

                string messageText = debtorMessageClient?.Text;

                var dbStatementCustomPrint = new DebtorPaymentStatementCustPrint(api, selectedItem, companyClient, debtorClient,
                                                                                 txtDateFrm.DateTime, txtDateTo.DateTime, logo, debtorEmailType.ToString(), this.AddInterest, messageText);

                object[] obj = new object[1];
                obj[0] = dbStatementCustomPrint as CustomPrintTemplateData;

                AddDockItem(TabControls.DebtorPaymentStatementPrintPage, obj, true, string.Format("{0} : {1},{2}", Uniconta.ClientTools.Localization.lookup("PrintPreview"), selectedItem.Name, selectedItem.AccountNumber));
            }
        }
        public async override Task InitQuery()
        {
            var master = stdVariant;

            if (master == null)
            {
                return;
            }
            var Combinations = master.Combinations ?? await master.LoadCombinations(api);

            if (Combinations == null)
            {
                return;
            }
            int desc = invItem._Decimals;
            var lst  = new List <ItemVariantLocal>();

            foreach (var rec in Combinations)
            {
                var r2 = new ItemVariantLocal(desc);
                StreamingManager.Copy(rec, r2);
                lst.Add(r2);
            }
            lst.Sort(new ItemVariantLocalSort());
            dgItemVariant.ItemsSource = lst;
            dgItemVariant.Visibility  = Visibility.Visible;
        }
Ejemplo n.º 12
0
 private void InitPage()
 {
     BusyIndicator = busyIndicator;
     layoutControl = layoutItems;
     if (LoadedRow == null)
     {
         frmRibbon.DisableButtons(new string[] { "Delete" });
         if (!isCopiedRow)
         {
             _bankImportFormatClient           = CreateNew() as BankImportFormatClient;
             _bankImportFormatClient.Seperator = UtilFunctions.GetDefaultDeLimiter();
             _bankImportFormatClient.CountryId = api.CompanyEntity._CountryId;
         }
     }
     else if (LoadedRow.CompanyId == -1)
     {
         isReadOnly = true;
         _bankImportFormatClient = CreateNew() as BankImportFormatClient;
         StreamingManager.Copy(LoadedRow, _bankImportFormatClient);
         _bankImportFormatClient.ClearCompany();
     }
     cmbFormat.ItemsSource    = Enum.GetValues(typeof(Uniconta.DataModel.BankImportFormatType));
     layoutItems.DataContext  = _bankImportFormatClient;
     frmRibbon.OnItemClicked += frmRibbon_OnItemClicked;
 }
        public static CompanyClient getCompany(Company company)
        {
            CompanyClient companyClient = new CompanyClient();

            StreamingManager.Copy(company, companyClient);
            return(companyClient);
        }
Ejemplo n.º 14
0
        public BankSpecificSettingsUK(CreditorPaymentFormat credPaymFormat)
        {
            CreditorPaymentFormatClientISOUK credPaymFormatISOUK = new CreditorPaymentFormatClientISOUK();

            StreamingManager.Copy(credPaymFormat, credPaymFormatISOUK);
            CredPaymFormat = credPaymFormatISOUK;
        }
Ejemplo n.º 15
0
        public async void CopyBalance()
        {
            ErrorCodes res = ErrorCodes.FieldCannotBeBlank;

            busyIndicator.IsBusy = true;
            Balance newItem = null;

            if (objBalance != null && objBalance.RowId != 0)
            {
                newItem = new Balance();
                StreamingManager.Copy(objBalance, newItem);

                var name = newItem.Name + Uniconta.ClientTools.Localization.lookup("Copy");
                newItem._Name = name;
                if (objBalance._Name != null)
                {
                    res = await api.Insert(newItem);
                }
                else
                {
                    res = ErrorCodes.FieldCannotBeBlank;
                }
            }
            busyIndicator.IsBusy = false;
            if (res == ErrorCodes.Succes)
            {
                itemsBalance.Add(newItem);
                cbBalance.SelectedItem = newItem;
            }
            else
            {
                UtilDisplay.ShowErrorCode(res);
            }
        }
Ejemplo n.º 16
0
 public override void Utility_Refresh(string screenName, object argument)
 {
     object[] args = argument as object[];
     if (screenName == TabControls.CrmProspectPage2 || screenName == TabControls.DebtorAccountPage2)
     {
         var gridSourceList            = (System.Collections.IList)dgCrmDebtorProspect.ItemsSource;
         UnicontaBaseEntity objectView = null;
         if (args[1] is CrmProspectClient)
         {
             objectView = StreamingManager.Copy(args[1] as CrmProspectClient, new CrmProspectView());
         }
         else if (args[1] is DebtorClient)
         {
             objectView = StreamingManager.Copy(args[1] as DebtorClient, new CrmDebtorView());
         }
         var index = gridSourceList.IndexOf(objectView);
         if (index > -1)
         {
             gridSourceList[index] = objectView;
             int rowHandle = dgCrmDebtorProspect.GetRowHandleByListIndex(index);
             dgCrmDebtorProspect.RefreshRow(rowHandle);
             dgCrmDebtorProspect.SelectedItem = objectView;
         }
         else if (objectView != null)
         {
             gridSourceList.Add(objectView);
             dgCrmDebtorProspect.ItemsSource  = null;
             dgCrmDebtorProspect.ItemsSource  = gridSourceList;
             dgCrmDebtorProspect.SelectedItem = objectView;
             dgCrmDebtorProspect.Visibility   = Visibility.Visible;
         }
     }
 }
Ejemplo n.º 17
0
        private void UpdateDate(DateTime date, DebtorTransPayment[] payments, bool isInterestnote)
        {
            if (payments == null || payments.Length == 0)
            {
                return;
            }

            var orgList = new DebtorTransPayment[payments.Length];

            for (int i = 0; (i < payments.Length); i++)
            {
                var debtTrans = payments[i];
                var org       = new DebtorTransPayment();
                StreamingManager.Copy(debtTrans, org);
                if (isInterestnote)
                {
                    debtTrans.LastInterest = date;
                }
                else
                {
                    debtTrans.LastCollectionLetter = date;
                    int collectionLetter = debtTrans._CollectionsLetters + 1;
                    debtTrans._CollectionsLetters = (byte)collectionLetter;
                }
                orgList[i] = org;
            }
            api.UpdateNoResponse(orgList, payments);
        }
Ejemplo n.º 18
0
 public override void Utility_Refresh(string screenName, object argument = null)
 {
     if (screenName == TabControls.ClosingSheetLinesAll)
     {
         BindGrid();
         mainList = null;
         ClosingSheetHasLinesList = null;
     }
     else if (screenName == TabControls.GLAccountPage2)
     {
         var args   = argument as object[];
         var entity = args[1] as GLAccountClient;
         if (entity != null)
         {
             var closingSheetAccount = new GLAccountClosingSheetClient();
             StreamingManager.Copy(entity, closingSheetAccount);
             args[1] = closingSheetAccount;
             dgGLTable.UpdateItemSource(args);
         }
     }
     else if (screenName == TabControls.UserNotesPage || screenName == TabControls.UserDocsPage && argument != null)
     {
         dgGLTable.UpdateItemSource(argument);
     }
 }
        private void OpenChartOfAccount()
        {
            DateTime fromDate = DateTime.MinValue, toDate = DateTime.MinValue;
            var      budgetMaster = this.master as GLBudget;

            if (budgetMaster != null)
            {
                fromDate = budgetMaster._FromDate;
                toDate   = budgetMaster._ToDate;
            }
            CWBudgetLineDialog objCWBudgetLineDialog = new CWBudgetLineDialog(api, fromDate, toDate);

            objCWBudgetLineDialog.Closed += delegate
            {
                if (objCWBudgetLineDialog.DialogResult == true)
                {
                    var Cache = api.GetCache(typeof(Uniconta.DataModel.GLAccount));
                    if (Cache == null)
                    {
                        return;
                    }

                    var fromAccount = objCWBudgetLineDialog.fromAccount;
                    if (fromAccount == null)
                    {
                        fromAccount = string.Empty;
                    }
                    var toAccount = objCWBudgetLineDialog.toAccount;
                    if (toAccount == string.Empty)
                    {
                        toAccount = null;
                    }
                    var gridData = (IEnumerable <GLBudgetLine>)dgGLBudgetLine.ItemsSource;
                    if (gridData.Count() == 1)
                    {
                        dgGLBudgetLine.SelectedItem = gridData.FirstOrDefault();
                        dgGLBudgetLine.DeleteRow();
                    }
                    foreach (var acc in (Uniconta.DataModel.GLAccount[])Cache.GetKeyStrRecords)
                    {
                        var Account = acc._Account;
                        if (string.Compare(Account, fromAccount) >= 0 && (toAccount == null || string.Compare(Account, toAccount) <= 0))
                        {
                            var objGLBudgetLineClient = new GLBudgetLineClient();
                            StreamingManager.Copy(objCWBudgetLineDialog.editrow, objGLBudgetLineClient);
                            objGLBudgetLineClient._Account = Account;
                            dgGLBudgetLine.AddRow(objGLBudgetLineClient, -1, false);
                        }
                    }
                }
            };
            objCWBudgetLineDialog.Show();
        }
Ejemplo n.º 20
0
        public InvVaraintSetupPage(UnicontaBaseEntity sourceData) : base(sourceData, true)
        {
            InitializeComponent();
            layoutControl = layoutItems;
            CompanyClient companyClient = new CompanyClient();

            StreamingManager.Copy(api.CompanyEntity, companyClient);
            editrow = companyClient;
            layoutItems.DataContext = editrow;
            SetVariants(editrow.NumberOfVariants);
            frmRibbon.OnItemClicked += FrmRibbon_OnItemClicked;
        }
Ejemplo n.º 21
0
        void CopyBankFormat(BankImportFormatClient selectedItem)
        {
            var bankFormat = new BankImportFormatClient();

            StreamingManager.Copy(selectedItem, bankFormat);
            bankFormat.SetMaster(api.CompanyEntity);
            var parms = new object[2] {
                bankFormat, false
            };

            AddDockItem(TabControls.ImportGLDailyJournalPage2, parms, Uniconta.ClientTools.Localization.lookup("BankFormatName"), "Add_16x16.png");
        }
Ejemplo n.º 22
0
        void localMenu_OnItemClicked(string type)
        {
            switch (type)
            {
            case "AddRow":
                if (NumberOfDimensions > 0)
                {
                    dgDimension.AddRow();
                }
                else
                {
                    UnicontaMessageBox.Show(Uniconta.ClientTools.Localization.lookup("OneDimensionNeeded"), Uniconta.ClientTools.Localization.lookup("Error"));
                }
                break;

            case "DeleteRow":
                dgDimension.DeleteRow();
                break;

            case "SaveGrid":
                Save(0);
                break;

            case "SetupDimension":
                var compClient = new CompanyClient();
                StreamingManager.Copy(api.CompanyEntity, compClient);
                AddDockItem(TabControls.GL_SetupDimension, compClient, Uniconta.ClientTools.Localization.lookup("SetupDimension"), "Add_16x16.png");
                break;

            case "JoinDimensions":
                var cwJoinTwoDimension = new CWJoinTwoDimensions(api, cmbDimensions.SelectedItem as string);
                cwJoinTwoDimension.Closed += async delegate
                {
                    if (cwJoinTwoDimension.DialogResult == true)
                    {
                        var ret = await cwJoinTwoDimension.JoinResult;
                        UtilDisplay.ShowErrorCode(ret);
                        if (ret == ErrorCodes.Succes)
                        {
                            dgDimension.Refresh();
                        }
                    }
                };
                cwJoinTwoDimension.Show();
                break;

#if !SILVERLIGHT
            case "ReorganizeDim":
                ReOrganizeDimensions();
                break;
#endif
            }
        }
Ejemplo n.º 23
0
        async private void OpenOutlook()
        {
            try
            {
                busyIndicator.IsBusy      = true;
                busyIndicator.BusyContent = Uniconta.ClientTools.Localization.lookup("LaunchingWaitMsg");
                var    selectedAccount = ((DebtorTransPayment)dgDebtorTranOpenGrid.SelectedItem).Account;
                byte[] logo            = await UtilDisplay.GetLogo(api);

                var Comp = api.CompanyEntity;

                var companyClient = Comp.CreateUserType <CompanyClient>();
                StreamingManager.Copy(Comp, companyClient);

                lastMessage = null; // just to reload message in case it has changed
                LoadDataForReport();

                int indexDebtorEmailType = 0;

                if (string.IsNullOrEmpty(collectionType))
                {
                    indexDebtorEmailType = SelectCollectionType();
                }
                else
                {
                    indexDebtorEmailType = AppEnums.DebtorEmailType.IndexOf(collectionType);
                }
                if (indexDebtorEmailType == -1)
                {
                    return;
                }

                var debtor          = accountCache.Get(selectedAccount) as Uniconta.DataModel.Debtor;
                var debtorEmailType = (DebtorEmailType)indexDebtorEmailType;
                var date            = BasePage.GetSystemDefaultDate();
                var selectedAccountstatementList = statementList.Where(p => p.AccountNumber == selectedAccount);
                var paymentStandardReport        = await GeneratePrintReport(selectedAccountstatementList, companyClient, date, logo, debtorEmailType);

                if (paymentStandardReport != null && paymentStandardReport.Count() == 1)
                {
                    InvoicePostingPrintGenerator.OpenReportInOutlook(api, paymentStandardReport.First(), debtor, debtorEmailType);

                    //Update Last dateTime
                    UpdateDate(date, selectedAccountstatementList.FirstOrDefault()?.ChildRecords, debtorEmailType == DebtorEmailType.InterestNote ? true : false);
                }
            }
            catch (Exception ex)
            {
                UnicontaMessageBox.Show(ex.Message, Uniconta.ClientTools.Localization.lookup("Exception"));
            }
            finally { busyIndicator.IsBusy = false; }
        }
        async void LoadSerieBatch()
        {
            if (batchLoaded)
            {
                return;
            }
            SetBusy();
            var lst = await api.Query <InvSerieBatch>(new InvSerieBatchOpen());

            if (lst == null || lst.Length == 0)
            {
                ClearBusy();
                return;
            }

            var mainList   = (List <InvItemStorageCount>)dgInvStockStatus.ItemsSource;
            var search     = new InvItemStorageCount();
            var sort       = new InvItemStorageLocalSort();
            var cnt        = mainList.Count;
            var extraItems = new List <InvItemStorageCount>(cnt);

            foreach (var rec in lst)
            {
                var itm = rec._Item;
                search._Item = itm;
                var idx = mainList.BinarySearch(search, sort);
                if (idx < 0)
                {
                    idx = ~idx;
                }
                if (idx >= 0 && idx < cnt && mainList[idx]._Item == itm)
                {
                    var r    = new InvItemStorageCount();
                    var item = mainList[idx];
                    StreamingManager.Copy(item, r);
                    r._SerieBatch  = rec._Number;
                    r._Qty         = rec._Qty - rec._QtySold;
                    r._QtyReserved = rec._QtyMarked;
                    r._Warehouse   = rec._Warehouse;
                    r._Location    = rec._Location;
                    r._QtyOrdered  = 0;
                    r._Quantity    = null;
                    extraItems.Add(r);
                }
            }
            extraItems.AddRange(mainList);
            extraItems.Sort(sort);
            dgInvStockStatus.ItemsSource = extraItems;
            SerieBatch.Visible           = true;
            batchLoaded = true;
            ClearBusy();
        }
        void SetHeader()
        {
            var syncMaster = dgSettlements.masterRecord as CreditorTransClient;

            if (syncMaster == null)
            {
                return;
            }
            StreamingManager.Copy(syncMaster as UnicontaBaseEntity, this.master);
            string header = string.Format("{0} ({1})", Uniconta.ClientTools.Localization.lookup("Settlements"), syncMaster.Voucher);

            SetHeader(header);
        }
        public GL_SetupDimension(UnicontaBaseEntity sourceData)
            : base(sourceData, true)
        {
            InitializeComponent();
            layoutControl = layoutItems;
            CompanyClient compClient = new CompanyClient();

            StreamingManager.Copy(api.CompanyEntity, compClient);
            editrow = compClient as CompanyClient;
            layoutItems.DataContext = editrow;
            SetDimensions(editrow.NumberOfDimensions);
            frmRibbon.OnItemClicked += frmRibbon_OnItemClicked;
        }
Ejemplo n.º 27
0
        private async void LoadInv()
        {
            busyIndicator.IsBusy = true;
            var list = await api.LoadCache(typeof(Uniconta.DataModel.InvItem));

            inventoryItemList = new List <InvItemClient>();
            foreach (var rec in (Uniconta.DataModel.InvItem[])list.GetNotNullArray)
            {
                if (rec._ItemType >= 2)
                {
                    var inv = new InvItemClient();
                    StreamingManager.Copy(rec, inv);
                    inventoryItemList.Add(inv);
                }
            }

            var cache = new SQLCache(inventoryItemList.ToArray(), true);

            var invBomLst = await api.Query <InvBOMClient>();

            InvItemClient master = null;

            foreach (var invBom in invBomLst)
            {
                if (invBom._ItemMaster != master?._Item)
                {
                    master = (InvItemClient)cache.Get(invBom._ItemMaster);
                }
                if (master != null)
                {
                    List <InvBOMClient> bomLst;
                    if (master.BOMs != null)
                    {
                        bomLst = (List <InvBOMClient>)master.BOMs;
                    }
                    else
                    {
                        master.BOMs = bomLst = new List <InvBOMClient>();
                    }
                    bomLst.Add(invBom);
                }
            }

            if (inventoryItemList.Count > 0)
            {
                dgInvItem.ItemsSource = null;
                dgInvItem.ItemsSource = inventoryItemList;
            }
            dgInvItem.Visibility = Visibility.Visible;
            busyIndicator.IsBusy = false;
        }
        public CWNets_NorgePaymentSetup(CrudAPI api, CreditorPaymentFormatClient paymentFormat)
        {
            Capi             = api;
            this.DataContext = this;
            InitializeComponent();
            paymentFormatNet = new CreditorPaymentFormatClientNets();
            StreamingManager.Copy(paymentFormat, paymentFormatNet);
            this.DataContext = paymentFormatNet;
            this.Title       = string.Format(Uniconta.ClientTools.Localization.lookup("SetupOBJ"), Uniconta.ClientTools.Localization.lookup("Payment"));
#if SILVERLIGHT
            Utility.SetThemeBehaviorOnChildWindow(this);
#endif
            this.Loaded += CW_Loaded;
        }
Ejemplo n.º 29
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            var selectedSMTP = leApproverSetup.SelectedItem as CompanySMTPClient;
            var number       = selectedSMTP?.Number;

            if (cSetting.ApproveSMTP != number)
            {
                var modified = new CompanySettings();
                StreamingManager.Copy(cSetting, modified);
                modified._ApproveSMTP = number;
                api.UpdateNoResponse(cSetting, modified);
            }
            this.DialogResult = true;
        }
 /// <summary>
 /// It returns the default PaymentFormat
 /// </summary>
 /// <param name="comp">Company</param>
 /// <returns></returns>
 public static CreditorPaymentFormatClient GetDefaultCreditorPaymentFormat(SQLCache credPaymFormatCache)
 {
     if (credPaymFormatCache != null)
     {
         var creditorPaymFormatList = (IEnumerable <CreditorPaymentFormat>)credPaymFormatCache.GetNotNullArray;
         var credPaymFormat         = (from dl in creditorPaymFormatList where dl._Default == true select dl).FirstOrDefault();
         if (credPaymFormat != null)
         {
             var credPaymFormatClient = new CreditorPaymentFormatClient();
             StreamingManager.Copy(credPaymFormat, credPaymFormatClient);
             return(credPaymFormatClient);
         }
     }
     return(null);
 }