void DeleteClosingSheetLine() { CWPostClosingSheet postingDialog = new CWPostClosingSheet(masterRecord._ToDate, true); postingDialog.Closed += async delegate { if (postingDialog.DialogResult == true) { if (UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("ConfirmDeleteOBJ"), Uniconta.ClientTools.Localization.lookup("ClosingSheetLines")), Uniconta.ClientTools.Localization.lookup("Confirmation"), MessageBoxButton.OKCancel) != MessageBoxResult.OK) { return; } busyIndicator.BusyContent = Uniconta.ClientTools.Localization.lookup("BusyMessage"); busyIndicator.IsBusy = true; var deleteResult = await postingApi.DeleteJournalLines(masterRecord, postingDialog.Code); if (deleteResult != ErrorCodes.Succes) { busyIndicator.IsBusy = false; UtilDisplay.ShowErrorCode(deleteResult); } else { BindGrid(); } } }; postingDialog.Show(); }
private void DeleteJournal(ProjectJournalPostedClient selectedItem) { if (selectedItem == null) { return; } var deleteDialog = new DeletePostedJournal(); deleteDialog.Closed += async delegate { if (deleteDialog.DialogResult == true) { var pApi = new UnicontaAPI.Project.API.PostingAPI(api); ErrorCodes res = await pApi.DeletePostedJournal(selectedItem, deleteDialog.Comment); if (res == ErrorCodes.Succes) { UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("Journaldeleted"), selectedItem.RowId), Uniconta.ClientTools.Localization.lookup("Message")); dgProjectPostedJournal.UpdateItemSource(2, selectedItem); } else { UtilDisplay.ShowErrorCode(res); } } }; deleteDialog.Show(); }
void InitPage(CrudAPI crudapi) { this.DataContext = this; ShowXapBuildDate(); layoutControl = layoutItems; #if SILVERLIGHT cbUserNationality.ItemsSource = Utility.GetEnumItemsWithPascalToSpace(typeof(CountryCode)); #else txtDotnetVersion.Text = System.Environment.Version.ToString(); #endif if (LoadedRow == null) { editrow = CreateNew() as UserClient; cbUserNationality.SelectedIndex = 0; } layoutItems.DataContext = editrow; currentTheme = editrow._Theme; Curlanguage = editrow._Language; #if !SILVERLIGHT cbDefaultPrinter.ItemsSource = UtilDisplay.GetInstalledPrinters(); RemoveMenu(); #elif SILVERLIGHT if (LoginPage.PCtype != LoginType.MAC_OOB) { RemoveMenu(); } #endif frmRibbon.OnItemClicked += frmRibbon_OnItemClicked; }
private void InitPage(UnicontaBaseEntity master = null) { InitializeComponent(); dgInvoicesGrid.UpdateMaster(master); SetRibbonControl(localMenu, dgInvoicesGrid); dgInvoicesGrid.BusyIndicator = busyIndicator; dgInvoicesGrid.api = api; var Comp = api.CompanyEntity; if (master == null) { filterDate = BasePage.GetFilterDate(Comp, false, 2); } localMenu.OnItemClicked += localMenu_OnItemClicked; initialLoad(); dgInvoicesGrid.ShowTotalSummary(); if (Comp.RoundTo100) { CostValue.HasDecimals = NetAmount.HasDecimals = TotalAmount.HasDecimals = Margin.HasDecimals = SalesValue.HasDecimals = false; } RibbonBase rb = (RibbonBase)localMenu.DataContext; if (!Comp.Order && !Comp.Purchase) { UtilDisplay.RemoveMenuCommand(rb, "CreateOrder"); } #if SILVERLIGHT UtilDisplay.RemoveMenuCommand(rb, "GenerateOioXml"); #endif dgInvoicesGrid.CustomSummary += dgInvoicesGrid_CustomSummary; }
private async void MarkOrderLineAgainstIT(InvTransClient selectedItem) { busyIndicator.IsBusy = true; Task <ErrorCodes> t; if (debtorOrderLine != null) { t = (new Uniconta.API.DebtorCreditor.OrderAPI(api)).MarkedOrderLineAgainstInvTrans(debtorOrderLine, selectedItem); } else { t = (new Uniconta.API.Inventory.TransactionsAPI(api)).MarkInvTransAgainstInvTrans(invtrans, selectedItem); } var err = await t; busyIndicator.IsBusy = false; if (err != ErrorCodes.Succes) { UtilDisplay.ShowErrorCode(err); } else { CloseDockItem(); } }
private void UpdatePrices() { var cwUpdateBjt = new CwCreateUpdateBudget(api, 1); #if !SILVERLIGHT cwUpdateBjt.DialogTableId = 2000000178; #endif cwUpdateBjt.Closed += async delegate { if (cwUpdateBjt.DialogResult == true) { var projLst = dgProjectGrid.GetVisibleRows() as IList <Uniconta.DataModel.Project>; BudgetAPI budgetApi = new BudgetAPI(api); var result = await budgetApi.UpdatePrices(CwCreateUpdateBudget.FromDate, CwCreateUpdateBudget.ToDate, CwCreateUpdateBudget.Employee, CwCreateUpdateBudget.Payroll, CwCreateUpdateBudget.PrCategory, CwCreateUpdateBudget.Group, CwCreateUpdateBudget.PrWorkSpace, cwUpdateBjt.InclProjectTask, projLst); if (result != ErrorCodes.Succes) { UtilDisplay.ShowErrorCode(result); } else { UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("Prices"), " ", Uniconta.ClientTools.Localization.lookup("Updated").ToLower()), Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK); } } }; cwUpdateBjt.Show(); }
void GetMenuItem() { RibbonBase rb = (RibbonBase)localMenu.DataContext; ibase = UtilDisplay.GetMenuCommandByName(rb, "ExpandAndCollapse"); ibaseCurrent = UtilDisplay.GetMenuCommandByName(rb, "ExpandCollapseCurrent"); }
private async void LoadInvTran() { setExpandAndCollapse(true); InventoryStatement.setDateTime(txtDateFrm, txtDateTo); DateTime FromDate = InventoryStatement.DefaultFromDate, ToDate = InventoryStatement.DefaultToDate; var fromItem = Convert.ToString(cmbFromAccount.EditValue); var toItem = Convert.ToString(cmbToAccount.EditValue); var transApi = new ReportAPI(api); busyIndicator.IsBusy = true; var listtran = (InvTransClientTotal[])await transApi.GetInvTrans(new InvTransClientTotal(), FromDate, ToDate, fromItem, toItem); if (listtran != null) { FillStatement(listtran); } else if (transApi.LastError != 0) { busyIndicator.IsBusy = false; UtilDisplay.ShowErrorCode(transApi.LastError); } dgInvTran.Visibility = Visibility.Visible; busyIndicator.IsBusy = false; }
void ConvertProspectToDebtor(CrmProspectClient crmProspect) { CWConvertProspectToDebtor cwwin = new CWConvertProspectToDebtor(api, crmProspect); cwwin.Closing += async delegate { if (cwwin.DialogResult == true) { if (cwwin?.DebtorClient == null) { return; } CrmAPI crmApi = new CrmAPI(api); var res = await crmApi.ConvertToDebtor(crmProspect, cwwin.DebtorClient); UtilDisplay.ShowErrorCode(res); if (res == ErrorCodes.Succes) { InitQuery(); } } }; cwwin.Show(); }
private async Task <byte[]> CreateZip(IEnumerable <VouchersClient> vouchers) { var zippedMemoryStream = UnistreamReuse.Create(); using (ZipOutputStream zipOutputStream = new ZipOutputStream(zippedMemoryStream)) { // Highest compression rating zipOutputStream.SetLevel(9); busyIndicator.IsBusy = true; foreach (var voucher in vouchers) { zippedMemoryStream.SecureSize(); if (voucher._Data == null) { await UtilDisplay.GetData(voucher, api); } byte[] attachment = voucher.Buffer; zippedMemoryStream.SecureSize(attachment.Length); // Write the data to the ZIP file string name = string.Format("{0}_{1}.{2}", voucher.Text, voucher.RowId, Enum.GetName(typeof(FileextensionsTypes), voucher.Fileextension)); name = name.Replace("/", "-").Replace(@"\", "-"); ZipEntry entry = new ZipEntry(name); zipOutputStream.PutNextEntry(entry); zipOutputStream.Write(attachment, 0, attachment.Length); } busyIndicator.IsBusy = false; zipOutputStream.Finish(); } return(zippedMemoryStream.ToArrayAndRelease()); }
async void LoadNotInvoiced(DateTime fromdate, DateTime todate) { busyIndicator.IsBusy = true; var lst = (ProjectTransClientLocal[])await(new InvoiceAPI(api)).GetTransNotOnOrder(master, fromdate, todate, new ProjectTransClientLocal()); if (lst == null) { busyIndicator.IsBusy = false; UtilDisplay.ShowErrorCode(ErrorCodes.NoLinesFound); return; } var orgList = dgGenerateOrder.ItemsSource as ICollection <ProjectTransClientLocal>; var newList = new List <ProjectTransClientLocal>(orgList.Count + lst.Length); foreach (var rec in orgList) { if (rec._SendToOrder != 0) { newList.Add(rec); } } for (int i = 0; (i < lst.Length); i++) { var rec = lst[i]; rec._remove = true; newList.Add(rec); } busyIndicator.IsBusy = false; dgGenerateOrder.ItemsSource = newList; api.ForcePrimarySQL = true; }
void RemoveMenu() { var Comp = api.CompanyEntity; RibbonBase rb = (RibbonBase)localMenu.DataContext; UtilDisplay.RemoveMenuCommand(rb, "AddRow"); }
private void GeneratePrimo() { var p = getSelectedItem(); if (p == null) { return; } CWCreatePrimo dialogPrimo = new CWCreatePrimo(this.api, p); dialogPrimo.Closed += delegate { if (dialogPrimo.DialogResult == true) { var s = string.Format(Uniconta.ClientTools.Localization.lookup("PrimoOnDate"), p._FromDate.ToShortDateString()); var EraseYearWindowDialog = new EraseYearWindow(s, true); EraseYearWindowDialog.Closed += async delegate { if (EraseYearWindowDialog.DialogResult == true) { ErrorCodes res = await FiApi.GeneratePrimoTransactions(p, dialogPrimo.BalanceName, dialogPrimo.PLText, dialogPrimo.Voucher, dialogPrimo.NumberserieText); UtilDisplay.ShowErrorCode(res); if (res == ErrorCodes.Succes && !p._Current) { var text = string.Format(Uniconta.ClientTools.Localization.lookup("MoveToOBJ"), string.Format("{0} - {1}", p._FromDate.ToShortDateString(), p._ToDate.ToShortDateString())); CWConfirmationBox dialog = new CWConfirmationBox(text, Uniconta.ClientTools.Localization.lookup("IsYearEnded"), true); dialog.Closing += delegate { var res2 = dialog.ConfirmationResult; if (res2 == CWConfirmationBox.ConfirmationResultEnum.Yes) { var source = (IList)dgFinanceYearGrid.ItemsSource; if (source != null) { IEnumerable <CompanyFinanceYearClient> gridItems = source.Cast <CompanyFinanceYearClient>(); foreach (var y in gridItems) { if (y._Current) { y.Current = false; break; } } } var org = StreamingManager.Clone(p); p.Current = true; api.UpdateNoResponse(org, p); } ; }; dialog.Show(); } } }; EraseYearWindowDialog.Show(); } }; dialogPrimo.Show(); }
private void ResetFiscalYear() { var p = getSelectedItem(); if (p == null) { return; } var interval = string.Format(Uniconta.ClientTools.Localization.lookup("FromTo"), p._FromDate.ToShortDateString(), p._ToDate.ToShortDateString()); var Header = string.Format("{0} : {1}", Uniconta.ClientTools.Localization.lookup("DeleteTrans"), interval); var EraseYearWindowDialog = new EraseYearWindow(Header, false); EraseYearWindowDialog.Closed += async delegate { if (EraseYearWindowDialog.DialogResult == true) { ErrorCodes res = await FiApi.EraseAllTransactions(p); if (res != ErrorCodes.Succes) { UtilDisplay.ShowErrorCode(res); } else { dgFinanceYearGrid.DeleteRow(); (dgFinanceYearGrid.View as TableView).FocusedRowHandle = 0; } } }; EraseYearWindowDialog.Show(); }
private async void Editrow_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "DeliveryZipCode") { if (lookupZipCode) { var deliveryCountry = editrow.DeliveryCountry ?? editrow.Country; var city = await UtilDisplay.GetCityAndAddress(editrow.DeliveryZipCode, deliveryCountry); if (city != null) { editrow.DeliveryCity = city[0]; var add1 = city[1]; if (!string.IsNullOrEmpty(add1)) { editrow.DeliveryAddress1 = add1; } var zip = city[2]; if (!string.IsNullOrEmpty(zip) && editrow.DeliveryZipCode != zip) { lookupZipCode = false; editrow.DeliveryZipCode = zip; } } } else { lookupZipCode = true; } } }
private void ReOpenAllTrans() { CWConfirmationBox dialog = new CWConfirmationBox(Uniconta.ClientTools.Localization.lookup("AreYouSureToContinue"), Uniconta.ClientTools.Localization.lookup("Confirmation"), false); dialog.Closing += async delegate { if (dialog.ConfirmationResult == CWConfirmationBox.ConfirmationResultEnum.Yes) { TransactionAPI transApi = new TransactionAPI(this.api); var masterAccount = dgCreditorTranOpenGrid.masterRecord as DCAccount; if (masterAccount != null) { busyIndicator.IsBusy = true; var errorCodes = await transApi.ReOpenAll(masterAccount, true); busyIndicator.IsBusy = false; UtilDisplay.ShowErrorCode(errorCodes); if (errorCodes == ErrorCodes.Succes) { InitQuery(); } } } }; dialog.Show(); }
private void CreateBudgetTask() { var cwCreateBjtTask = new CwCreateBudgetTask(api, 0); #if !SILVERLIGHT cwCreateBjtTask.DialogTableId = 2000000179; #endif cwCreateBjtTask.Closed += async delegate { if (cwCreateBjtTask.DialogResult == true) { var projLst = dgProjectGrid.GetVisibleRows() as IList <Uniconta.DataModel.Project>; BudgetAPI budgetApi = new BudgetAPI(api); var result = await budgetApi.CreateBudgetTask(CwCreateBudgetTask.Employee, CwCreateBudgetTask.Payroll, CwCreateBudgetTask.Group, CwCreateBudgetTask.PrWorkSpace, cwCreateBjtTask.DeleteBudget, CwCreateBudgetTask.BudgetTaskPrincip, CwCreateBudgetTask.TaskHours, projLst); if (result != ErrorCodes.Succes) { UtilDisplay.ShowErrorCode(result); } else { UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("Budget"), " ", Uniconta.ClientTools.Localization.lookup("Created").ToLower()), Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK); } } }; cwCreateBjtTask.Show(); }
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)); }
private void CreateTaskFromTask() { var cwCreateTask = new CWCreateTaskFromTask(api); #if !SILVERLIGHT cwCreateTask.DialogTableId = 2000000105; #endif cwCreateTask.Closed += async delegate { if (cwCreateTask.DialogResult == true) { var projLst = dgProjectGrid.GetVisibleRows() as IList <Uniconta.DataModel.Project>; BudgetAPI budgetApi = new BudgetAPI(api); var result = await budgetApi.CreateTaskFromTask(CWCreateTaskFromTask.FromPrWorkSpace, CWCreateTaskFromTask.ToPrWorkSpace, CWCreateTaskFromTask.ProjectTemplate, CWCreateTaskFromTask.AddYear, projLst); if (result != ErrorCodes.Succes) { UtilDisplay.ShowErrorCode(result); } else { UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("Tasks"), " ", Uniconta.ClientTools.Localization.lookup("Created").ToLower()), Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK); } } }; cwCreateTask.Show(); }
static public void ExecuteDebtorCollection(CrudAPI Api, BusyIndicator busyIndicator, IEnumerable <DCTransOpen> dcTransOpenList, IEnumerable <double> feelist, IEnumerable <double> changelist, bool isCurrencyReport, DebtorEmailType emailType, string emails = null, bool onlyThisEmail = false, bool isAddInterest = false) { var rapi = new ReportAPI(Api); var cwDateSelector = new CWDateSelector(); #if !SILVERLIGHT cwDateSelector.DialogTableId = 2000000025; #endif cwDateSelector.Closed += async delegate { if (cwDateSelector.DialogResult == true) { busyIndicator.IsBusy = true; busyIndicator.BusyContent = Uniconta.ClientTools.Localization.lookup("SendingWait"); var result = await rapi.DebtorCollection(dcTransOpenList, feelist, changelist, cwDateSelector.SelectedDate, emailType, isCurrencyReport, emails, onlyThisEmail); busyIndicator.IsBusy = false; if (result == ErrorCodes.Succes) { UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("SendEmailMsgOBJ"), isAddInterest ? Uniconta.ClientTools.Localization.lookup("InterestNote") : Uniconta.ClientTools.Localization.lookup("CollectionLetter")), Uniconta.ClientTools.Localization.lookup("Message"), MessageBoxButton.OK); } else { UtilDisplay.ShowErrorCode(result); } } }; cwDateSelector.Show(); }
private void HideMenuCommand(InvItemClient invItem) { if (invItem == null || invItem._ItemType < (byte)Uniconta.DataModel.ItemType.BOM) { UtilDisplay.RemoveMenuCommand((RibbonBase)localMenu.DataContext, new string[] { "PartInvItems" }); } }
void InitializePage(UnicontaBaseEntity _master) { this.DataContext = this; InitializeComponent(); master = _master; SetRibbonControl(localMenu, dgProjectTransaction); RibbonBase rb = (RibbonBase)localMenu.DataContext; if (master != null) { dgProjectTransaction.UpdateMaster(master); ribbonControl.DisableButtons("Save"); } else { UtilDisplay.RemoveMenuCommand(rb, new string[] { "EditAll", "Save" }); } if (master is Uniconta.DataModel.Project) { iIncludeSubProBase = UtilDisplay.GetMenuCommandByName(rb, "InclSubProjects"); } else { UtilDisplay.RemoveMenuCommand(rb, "InclSubProjects"); } dgProjectTransaction.api = api; dgProjectTransaction.BusyIndicator = busyIndicator; dgProjectTransaction.ShowTotalSummary(); localMenu.OnItemClicked += LocalMenu_OnItemClicked; localMenu.OnChecked += LocalMenu_OnChecked; }
void SendEmail() { var rows = (ICollection <CrmCampaignMemberClient>)dgEmailList.GetVisibleRows(); if (rows.Count == 0) { return; } var cwSendEmail = new CwSendEmail(api); cwSendEmail.Closed += async delegate { if (cwSendEmail.DialogResult == true && cwSendEmail.CompanySMTP != null) { var crmAPI = new CrmAPI(api); ErrorCodes res; if (cwSendEmail.SendTestEmail) { res = await crmAPI.SendMailTest(cwSendEmail.CompanySMTP, cwSendEmail.Email, cwSendEmail.Name); } else { res = await crmAPI.SendMail(cwSendEmail.CompanySMTP, rows, cwSendEmail.FollowUp); } UtilDisplay.ShowErrorCode(res); } }; cwSendEmail.Show(); }
void RecalculateAmount() { var lst = dgProjInvProjectLineGrid.ItemsSource as IEnumerable <ProjectInvoiceProjectLineLocal>; if (lst == null) { return; } double adjustment = invoiceProposal._OrderTotal - invoiceProposal._ProjectTotal; double Amountsum = lst.Sum(x => x._SalesAmount); double difference = adjustment - Amountsum; RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var adjust = Uniconta.ClientTools.Localization.lookup("Adjustment"); var strTotal = Uniconta.ClientTools.Localization.lookup("Total"); var diff = Uniconta.ClientTools.Localization.lookup("Diff"); foreach (var grp in groups) { if (grp.Caption == adjust) { grp.StatusValue = adjustment.ToString("N2"); } if (grp.Caption == strTotal) { grp.StatusValue = Amountsum.ToString("N2"); } if (grp.Caption == diff) { grp.StatusValue = difference.ToString("N2"); } } }
void SetStatusText(double primo, double sum) { string format = RoundTo100 ? "N0" : "N2"; RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var thisyear = Uniconta.ClientTools.Localization.lookup("ThisYear"); var Change = Uniconta.ClientTools.Localization.lookup("Change"); var NewBalance = Uniconta.ClientTools.Localization.lookup("NewBalance"); foreach (var grp in groups) { if (grp.Caption == thisyear) { grp.StatusValue = primo.ToString(format); } else if (grp.Caption == Change) { grp.StatusValue = sum.ToString(format); } else if (grp.Caption == NewBalance) { LineTotal = primo + sum; grp.StatusValue = LineTotal.ToString(format); } else { grp.StatusValue = string.Empty; } } }
async private void CreateProductionReport(ProductionOrderClient productionOrder) { var companyClient = Utility.GetCompanyClientUserInstance(api.CompanyEntity); var getLogo = await UtilDisplay.GetLogo(api); var productionOrderLines = await api.Query <ProductionOrderLineClient>(productionOrder); if (productionOrderLines != null && productionOrderLines.Length > 0) { var productionReportSource = new ProductionStandardReportClient(companyClient, productionOrder, productionOrderLines, getLogo, Uniconta.ClientTools.Localization.lookup("ProductionOrder")); var standardReportSrc = new IProductionStandardReport[] { productionReportSource }; var standardPrint = new StandardPrintReport(api, standardReportSrc, (int)StandardReports.ProductionOrder); await standardPrint.InitializePrint(); if (standardPrint?.Report != null) { AddDockItem(TabControls.StandardPrintReportPage, new object[] { new DevExpress.XtraReports.UI.XtraReport[] { standardPrint.Report } }, string.Format("{0}: {1}", Uniconta.ClientTools.Localization.lookup("PrintPreview"), productionOrder.ProductionNumber)); } } else { UnicontaMessageBox.Show(Uniconta.ClientTools.Localization.lookup("NoLinesFound"), Uniconta.ClientTools.Localization.lookup("Warning"), MessageBoxButton.OK); } }
void GetExpandAndCollapseMenuItem() { RibbonBase rb = (RibbonBase)localMenu.DataContext; ibaseExpandGroups = UtilDisplay.GetMenuCommandByName(rb, "ExpandGroups"); ibaseCollapseGroups = UtilDisplay.GetMenuCommandByName(rb, "CollapseGroups"); }
void RemoveMenuItem() { RibbonBase rb = (RibbonBase)frmRibbon.DataContext; var Comp = api.CompanyEntity; UtilDisplay.RemoveMenuCommand(rb, "PhysicalVou"); }
void ModifyApprover(VouchersClient voucher) { var cwEmployee = new CWEmployee(api); #if !SILVERLIGHT cwEmployee.DialogTableId = 2000000076; #endif cwEmployee.Closed += async delegate { if (cwEmployee.DialogResult == true) { var result = await docApi.ChangeApprover(voucher, cwEmployee.Employee, cwEmployee.Comment); if (result == ErrorCodes.Succes) { RemoveRow(voucher); } else { UtilDisplay.ShowErrorCode(result); } } }; cwEmployee.Show(); }
private void InitPage(UnicontaBaseEntity soucedata) { AddFilterAndSort = true; InitializeComponent(); if (soucedata != null) { masterSub = soucedata; dgSubInvoicesGrid.UpdateMaster(soucedata); if (invoicePartner == null) { invoicePartner = soucedata as Partner; } RibbonBase rb = (RibbonBase)localMenu.DataContext; UtilDisplay.RemoveMenuCommand(rb, new string[] { "SendAsEmailOnDate", "PostInvoiceOnDate" }); } showFields = (api.session.User._Role >= (byte)Uniconta.Common.User.UserRoles.Reseller); localMenu.dataGrid = dgSubInvoicesGrid; SetRibbonControl(localMenu, dgSubInvoicesGrid); dgSubInvoicesGrid.api = api; dgSubInvoicesGrid.BusyIndicator = busyIndicator; localMenu.OnItemClicked += localMenu_OnItemClicked; #if SILVERLIGHT ribbonControl.DisableButtons(new string[] { "ShowInvoice" }); #endif dgSubInvoicesGrid.ShowTotalSummary(); }