public override void ReadValue(GridControl gridControl, GridColumnDataEventArgs e) { int movieIndex = gridControl.GetRowVisibleIndexByHandle(gridControl.GetRowHandleByListIndex(e.ListSourceRowIndex)) + 1; int moviesCount = gridControl.VisibleRowCount; e.Value = string.Format(ConstStrings.Get("MovieOf"), movieIndex, moviesCount); }
public void CreateCustomer_Save_CheckTitle() { using (CustomerDetail detail = (CustomerDetail)ModulesManager.Current.OpenModuleObjectDetail(new CustomerDetailObject(Session, null), false)) { detail.CustomerEdit.VRObjectEditObject.VideoRentObject.FirstName = "x"; detail.CustomerEdit.VRObjectEditObject.VideoRentObject.LastName = "y"; Assert.AreEqual(ConstStrings.Get("NewCustomer") + " *", detail.Title); Assert.IsTrue(detail.Save()); Assert.AreEqual("x y", detail.Title); } }
static DemoModuleCategory GetPreparedCurrentCustomersRentCategory() { DemoModuleCategory category = new VideoRentModuleCategory(GroupRental, ConstStrings.Get("RentModule"), "Sale"); BindingOperations.SetBinding(category, DemoModuleCategory.TitleProperty, new Binding("CurrentCustomer.FullName") { Source = CurrentCustomerProvider.Current, Converter = new StringFormatConverter(), ConverterParameter = ConstStrings.Get("RentModulePattern") }); BindingOperations.SetBinding(category, ForwardingHelper.DataObjectProperty, new Binding("CurrentCustomer.Photo") { Source = CurrentCustomerProvider.Current }); return(category); }
public void TryDeleteDenyObject_CheckInfoMessage() { Assert.IsNotNull(Anton.DoRent(new RentInfo(Avatar, MovieItemFormat.DVD))); SessionHelper.CommitSession(Session, null); Assert.IsFalse(Avatar.AllowDelete); MoviesList moviesList = (MoviesList)ModulesManager.Current.OpenModuleObjectDetail(new MoviesListObject(Session), false); moviesList.MoviesEdit.CurrentRecord = SessionHelper.GetObject <Movie>(Avatar, moviesList.MoviesEdit.VRObjectsEditObject.VideoRentObjects.Session); TestMessageBoxView.ShowDelegate = MessageBoxShow; Assert.IsFalse(moviesList.MoviesEdit.DeleteCurrentRecord()); Assert.AreEqual(ConstStrings.Get("ObjectCanNotBeDeleted"), message); TestMessageBoxView.ShowDelegate = null; moviesList.Dispose(); }
//TutorialControlBase module; //DemoProducts products = DemoProducts.None; public ModuleInfo(string name, Type type, string description, string imageName, string group) { if (!type.IsSubclassOf(typeof(UserControl))) { throw new ArgumentException(ConstStrings.Get("SubclassError")); } this.name = name; this.type = type; this.imageName = imageName; this.description = description; this.group = group; //this.module = null; //this.products = products; }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string name = value as string; if (name == null || name == ConstStrings.Get("None")) { return(null); } Marker2DModel model; if (!models.TryGetValue(name, out model)) { return(null); } return(model); }
/// <summary> /// Application grouprs /// </summary> static void CreateGroupAndCategories() { GroupRental = new VideoRentModuleGroup(ConstStrings.Get("RentalGroup"), "Group_Rental"); GroupCatalog = new VideoRentModuleGroup(ConstStrings.Get("CatalogGroup"), "Group_Catalog"); GroupAdministration = new VideoRentModuleGroup(ConstStrings.Get("AdminGroup"), "Group_Administrator"); CategoryMovies = new VideoRentModuleCategory(GroupCatalog, ConstStrings.Get("MoviesModule"), "Movie"); CategoryArtists = new VideoRentModuleCategory(GroupCatalog, ConstStrings.Get("ActorsModule"), "Actor"); CategoryMovieCategories = new VideoRentModuleCategory(GroupCatalog, ConstStrings.Get("MovieCategories"), "Categories"); CategoryCompanies = new VideoRentModuleCategory(GroupCatalog, ConstStrings.Get("CompaniesModule"), "Company"); CategoryCustomers = new VideoRentModuleCategory(GroupRental, ConstStrings.Get("CustomersModule"), "Person"); CategoryAthlets = new VideoRentModuleCategory(GroupRental, ConstStrings.Get("AthletsModule"), "Person"); CategoryCurrentCustomerTransactions = new VideoRentModuleCategory(GroupRental, ConstStrings.Get("AccountTransactions"), "Revenue"); CategoryCurrentCustomerRents = GetPreparedCurrentCustomersRentCategory(); }
public static UnitOfWork SafeDeleteNoCommit(VideoRentBaseObject obj, string shureToDeleteMessage, Action <object> action) { if (!obj.AllowDelete) { MessageBox.Show(ConstStrings.Get("ObjectCanNotBeDeleted"), ConstStrings.Get("Warning"), MessageBoxButton.OK, MessageBoxImage.Warning); return(null); } if (!IsSureToDelete(shureToDeleteMessage)) { return(null); } if (action != null) { action(null); } UnitOfWork uow = (UnitOfWork)obj.Session; obj.Delete(); return(uow); }
public static void FillNavBar(NavBarControl navBar, NavBarGroupStyle groupStyle, NavBarImage groupCaptionImage) { if (navBar == null) { return; } navBar.BeginUpdate(); for (int i = 0; i < Count; i++) { if (GetItem(i).Group == ConstStrings.Get("AboutGroup")) { continue; } NavBarItem item = new NavBarItem(); navBar.Items.Add(item); item.Caption = GetItem(i).Name; item.Tag = GetItem(i); GetNavBarGroup(navBar, GetItem(i).Group, groupStyle, groupCaptionImage).ItemLinks.Add(new NavBarItemLink(item)); } navBar.EndUpdate(); }
public void ShowUnableToOpenMessage(bool createNew) { ThreadHelper.DoInThread(wnd.Dispatcher, () => MessageBox.Show(createNew ? ConstStrings.Get("UnableCreateDBMessage") : ConstStrings.Get("UnableOpenDBMessage"), ConstStrings.Get("Error"), MessageBoxButton.OK, MessageBoxImage.Error)); }
public void Process(Exception e) { MessageBox.Show(e.Message, ConstStrings.Get("Warning"), MessageBoxButton.OK, MessageBoxImage.Warning); }
static void StartProcess(string processName) { #if !SL //TODO try { Process.Start(processName); } catch (Exception ex) { DevExpress.VideoRent.ViewModel.ViewModelBase.MessageBox.Show(ex.Message, ConstStrings.Get("Error"), DevExpress.VideoRent.ViewModel.ViewModelBase.MessageBoxButton.OK, DevExpress.VideoRent.ViewModel.ViewModelBase.MessageBoxImage.Error); } #endif }