Exemple #1
0
        protected void BtnAddDelegate_Click(object sender, EventArgs e)
        {
            string   fullname   = EmployeesDdl.Text;
            DateTime startdate  = CalStartAddDelegate.SelectedDate;
            DateTime enddate    = CalEndAddDelegate.SelectedDate;
            string   currentdep = DisbursementLogic.GetCurrentDep();

            if (startdate >= DateTime.Today && startdate <= enddate && startdate != null && enddate != null)
            {
                RequisitionLogic.AddDelegate(fullname, startdate, enddate, currentdep);
                statusMessage.Text      = (fullname + " has been delegated as the department head from " + startdate.ToShortDateString() + " to " + enddate.ToShortDateString());
                statusMessage.Visible   = true;
                statusMessage.ForeColor = Color.Green;
                ShowCurrentDelegate();
            }
            else
            {
                statusMessage.Text      = "Please enter a valid period";
                statusMessage.Visible   = true;
                statusMessage.ForeColor = Color.Red;
            }
        }