Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (this.appInstance.currentStatus == FreelancerGestion.Status.CheckedOut)
            {
                this.appInstance.currentStatus = FreelancerGestion.Status.CheckedIn;
                this.appInstance.checks.Add(new Check(
                                                DateTime.Now,
                                                FreelancerGestion.Status.CheckedIn,
                                                "" + "" + FreelancerGestion.GetExternalIp()
                                                ));
                this.refreshForm();
            }
            else
            {
                this.appInstance.currentStatus = FreelancerGestion.Status.CheckedOut;
                this.appInstance.checks.Add(new Check(
                                                DateTime.Now,
                                                FreelancerGestion.Status.CheckedOut,
                                                "" + FreelancerGestion.GetExternalIp()
                                                ));
                this.refreshForm();
            }

            if (this.appInstance.currentStatus == FreelancerGestion.Status.CheckedOut)
            {
                this.checkButton.Text = "Check in";
            }
            else
            {
                this.checkButton.Text = "Check out";
            }

            this.appInstance.saveChecksInXml();
        }
Пример #2
0
        public Form2(FreelancerGestion appInstance)
        {
            this.appInstance = appInstance;

            InitializeComponent();

            this.refresh();
        }
Пример #3
0
        public Form1()
        {
            InitializeComponent();

            //this.checksList.AutoGenerateColumns = true;

            /*if (!EventLog.SourceExists("FreelancerGestion"))
             *  EventLog.CreateEventSource("FreelancerGestion", "FreelancerGestion");*/

            this.appInstance = new FreelancerGestion();

            //Check list
            this.refreshForm();

            //Button
            if (this.appInstance.currentStatus == FreelancerGestion.Status.CheckedOut)
            {
                this.checkButton.Text = "Check in";
            }
            else if (this.appInstance.currentStatus == FreelancerGestion.Status.CheckedIn)
            {
                this.checkButton.Text = "Check out";
            }
        }