void InitPage(CrudAPI crudapi) { ribbonControl = frmRibbon; BusyIndicator = busyIndicator; layoutControl = layoutItems; cbCountry.ItemsSource = Enum.GetValues(typeof(Uniconta.Common.CountryCode)); cbCurrentERP.ItemsSource = Enum.GetValues(typeof(Uniconta.Common.ERPSystem)); cbCompanyType.ItemsSource = Enum.GetValues(typeof(Uniconta.Common.CompanyType)); cbCommingFrom.ItemsSource = Enum.GetValues(typeof(Uniconta.Common.ContactFrom)); cbCloseReason.ItemsSource = Enum.GetValues(typeof(Uniconta.DataModel.CloseReasonType)); var Comp = crudapi.CompanyEntity; if (LoadedRow == null) { frmRibbon.DisableButtons("Delete"); if (!isCopiedRow) { editrow = CreateNew() as PartnerProspectClient; editrow.Country = Comp._CountryId; } } layoutItems.DataContext = editrow; frmRibbon.OnItemClicked += frmRibbon_OnItemClicked; editrow.PropertyChanged += Editrow_PropertyChanged; txtCompanyRegNo.EditValueChanged += TxtCVR_EditValueChanged; lePid.api = api; if (BasePage.session.User._Role == (byte)Uniconta.Common.User.UserRoles.Reseller) { this.liPid.Visibility = Visibility.Collapsed; this.liResellerName.Visibility = Visibility.Collapsed; } }
void CopyRecord(PartnerProspectClient selectedItem) { if (selectedItem == null) { return; } var prospect = Activator.CreateInstance(selectedItem.GetType()) as PartnerProspectClient; CorasauDataGrid.CopyAndClearRowId(selectedItem, prospect); var parms = new object[2] { prospect, false }; AddDockItem(TabControls.PartnerProspectPage2, parms, Uniconta.ClientTools.Localization.lookup("PartnerProspects"), "Add_16x16.png"); }