Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PersonnelSystem ps          = PersonnelSystem.GetPersonnelSystem(this);
            Person          loginPerson = ps.LoginPerson;

            string name = loginPerson.FirstNameAndLastName;

            LinkButton1.Text     = "<img src='Image/Small/person.png'/>" + name;
            LinkButton10.Visible = true;

            int v1 = DatabaseManager.GetLeaveRequiredCountByCommanderLow(loginPerson.CitizenID);

            if (v1 != 0)
            {
                lbLeaveCommentCount.Text    = "" + v1;
                lbLeaveCommentCount.Visible = true;
            }
            else
            {
                lbLeaveCommentCount.Text    = "";
                lbLeaveCommentCount.Visible = false;
            }

            int v2 = DatabaseManager.GetLeaveRequiredCountByCommanderHigh(loginPerson.CitizenID);

            if (v2 != 0)
            {
                lbLeaveAllowCount.Text    = "" + v2;
                lbLeaveAllowCount.Visible = true;
            }
            else
            {
                lbLeaveAllowCount.Text    = "";
                lbLeaveAllowCount.Visible = false;
            }

            /*if(v1 + v2 == 0) {
             *  lbN1.Text = "ไม่มีการแจ้งเตือนการลา";
             * } else {
             *  lbN1.Text = "คุณมี " + (v1 + v2) + " การแจ้งเตือนการลา";
             * }*/


            if (!IsPostBack)
            {
                DatabaseManager.AddCounter();
            }
        }