Ejemplo n.º 1
0
 public void ButtonOKClick(IEventForm EventFormView, string name, string price, string desc, decimal kol, DateTime time, string categoryName, string locationName)
 {
     try
     {
         float pr = Convert.ToSingle(price);
         if (name == "")
         {
             MessageBox.Show("Upišite naziv!");
         }
         else if (categoryName == "")
         {
             MessageBox.Show("Odaberite kategoriju!");
         }
         else if (locationName == "")
         {
             MessageBox.Show("Odaberite lokaciju!");
         }
         else if (kol <= 0)
         {
             MessageBox.Show("Upišite broj karata!");
         }
         else
         {
             Category cat = CategoryRepository.getInstance().getCategoryByName(categoryName);
             Location loc = LocationRepository.getInstance().getLocationByName(locationName);
             AddNewEvent(name, desc, pr, Convert.ToInt32(kol), time, cat, loc);
             EventFormView.CloseEventForm();
         }
     }
     catch (EventAlreadyExists ex)
     {
         MessageBox.Show("Događaj s ovim nazivom već postoji!");
     }
     catch
     {
         MessageBox.Show("Upišite ispravnu cijenu!");
     }
 }
Ejemplo n.º 2
0
 public void SetEventFormParameters(IEventForm EventFormView)
 {
     EventFormView.SetDateTimeFormat("MMMM dd, yyyy HH:mm:ss");
     EventFormView.SetCategories(GetCategoryList());
 }
 public void SetEventFormParameters(IEventForm EventFormView)
 {
     EventFormView.SetLocations(GetLocationList());
 }