Пример #1
0
        /// <summary>
        ///   Constructor
        /// </summary>
        public WorkerFrm()
        {
            InitializeComponent();

            try
            {
                this._keyServiceUsers              = new ServiceUserCollection();
                this._keyServiceUsers.ObjectAdded += new Cura.Common.Collection <ServiceUser> .CollectionChangeEvent(this.KeyServiceUsersChanged);

                this._keyServiceUsers.ObjectRemoved += new Cura.Common.Collection <ServiceUser> .CollectionChangeEvent(this.KeyServiceUsersChanged);

                this._availabilities = new AvailabilityCollection();

                this._availabilities.ObjectAdded += new Cura.Common.Collection <Availability> .CollectionChangeEvent(this.AvailabilitiesChanged);

                this._availabilities.ObjectRemoved += new Cura.Common.Collection <Availability> .CollectionChangeEvent(this.AvailabilitiesChanged);

                this._longLat = new LongLat();

                this.tabControl1.SelectedIndex = 0;

                int weeks = Settings.Instance.rotaweekcount;

                for (int i = 0; i < weeks; i++)
                {
                    treeView1.Nodes.Add("Week " + (i + 1).ToString());
                }

                treeView1.MouseDown += (sender, args) => treeView1.SelectedNode = treeView1.GetNodeAt(args.X, args.Y);

                //show core hours first
                splitContainer5.Panel1Collapsed = false;
                splitContainer5.Panel2Collapsed = true;


                ((OLVColumn)callHistoryObjectListView.Columns[0]).GroupKeyGetter = delegate(object rowObject)
                {
                    Call_Slim model = rowObject as Call_Slim;

                    return(model.Day);
                };

                numberLbl.Text = String.Format("{0} Number", Settings.Instance.WorkerNumberAlias).Trim();
                splitContainer8.SplitterDistance = pictureBox12.Width + numberLbl.Width + 5;
            }
            catch (Exception ex)
            {
                Cura.Common.Common.LogError("Failed To Initialise Worker Form", ex);
            }
        }
Пример #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ServiceUserFrm()
        {
            InitializeComponent();

            this._keyWorkers = new WorkerCollection();

            this._keyWorkers.ObjectAdded += new Cura.Common.Collection <Worker> .CollectionChangeEvent(this.KeyWorkersChanged);

            this._keyWorkers.ObjectRemoved += new Cura.Common.Collection <Worker> .CollectionChangeEvent(this.KeyWorkersChanged);

            this._longLat = new LongLat();
            this.tabControl1.SelectedIndex = 0;

            ((OLVColumn)callHistoryObjectListView.Columns[0]).GroupKeyGetter = delegate(object rowObject)
            {
                Call_Slim model = rowObject as Call_Slim;

                return(model.Day);
            };

            numberLbl.Text = String.Format("{0} Number", Settings.Instance.ServiceUserNumberAlias).Trim();
            splitContainer8.SplitterDistance = pictureBox12.Width + numberLbl.Width + 5;
        }