示例#1
0
 public GangInfo(CriminalGang gang)
 {
     InitializeComponent();
     Gang                    = gang;
     FileCabinet             = FileCabinet.GetInstance();
     nameBox.Text            = Gang.Name;
     foundationtimebox.Value = Gang.FoundationDate;
     countryBox.SelectedItem = Gang.Country;
     gangImageBox.Image      = Gang.Image;
     featuresBox.Text        = Gang.Features;
     IdLabelValue.Text       = Gang.Id.ToString();
     leaderlinkedLabel.Text  = Gang.LeaderName == " " ? "None": Gang.LeaderName;
     if (User.Role == UserRole.User)
     {
         foreach (Control c in Controls)
         {
             if (c is TextBox t)
             {
                 t.ReadOnly = true;
             }
             if (c is GroupBox g)
             {
                 foreach (Control gc in g.Controls)
                 {
                     if (gc is RichTextBox rt)
                     {
                         rt.ReadOnly = true;
                     }
                 }
             }
             ComboBox cb = c as ComboBox;
             if (cb != null)
             {
                 cb.Enabled = false;
             }
             DateTimePicker dt = c as DateTimePicker;
             if (dt != null)
             {
                 dt.Enabled = false;
             }
             imageChoseButton.Hide();
             addButton.Hide();
             leaderChoseButton.Hide();
             saveButton.Hide();
             deleteButton.Hide();
         }
     }
 }
示例#2
0
        //Constructor
        public ListMenuPresenter(ListMenu lView)
        {
            listView    = lView;
            fileCabinet = FileCabinet.GetInstance();
            listView.AddCriminalEvent   += ListView_AddCriminalEvent;
            listView.LoadEvent          += ListView_LoadEvent;
            listView.SaveEvent          += ListView_SaveEvent;
            listView.MoveToArchiveEvent += ListView_MoveToArchiveEvent;
            listView.MoveToListevent    += ListView_MoveToListevent;
            listView.AutorizationEvent  += ListView_AutorizationEvent;
            listView.OnUserCahngeEvent  += OnUserChange;
            listView.AddGangEvent       += ListView_AddGangEvent;
            listView.DeleteEvent        += ListView_DeleteEvent;
            listView.ResetEvent         += ListView_ResetEvent;

            listView.SearchCriminalEvent += ListView_SearchCriminalEvent;

            listView.SearchInArchiveEvent += ListView_SearchInArchiveEvent;
        }
示例#3
0
 //Constructors
 public GangInfo()
 {
     InitializeComponent();
     Gang        = new CriminalGang();
     FileCabinet = FileCabinet.GetInstance();
 }
示例#4
0
 public GangList()
 {
     InitializeComponent();
     fileCabinet = FileCabinet.GetInstance();
 }