protected void btnConfirmComplete_Click(object sender, EventArgs e)
    {
        PromotionAssigment promotionAssigment = new PromotionAssigment();

        string minNo = DropDownLMinuteNo.SelectedItem.Text;
        if (minNo != "-1")
        {
            lblminNo.Visible = false;
            string[] splitVacancyDetail = minNo.Split(new string[] { PageConstants.GREATER_GREATER_THAN }, StringSplitOptions.None);
            promotionAssigment.MinuteNo = splitVacancyDetail[1].Trim();

        }
        else
        {
            resetAllControl();
            lblminNo.Visible = true;
            return;
        }

        Promotion promotion = new Promotion();

        promotion.MinuteNo = promotionAssigment.MinuteNo;

        PromotionManager promotionManager = new PromotionManager(promotion);
        TransactionResponse promotionResponse = promotionManager.updatePromotionStatus(promotion, PromotionConstants.PROMOTION_NOT_NEED_VACANCY_CANT_POSTED_BY_DISTRICT);

        if (!promotionResponse.isSuccessful())
        {
            msgPanel.Visible = true;
            ErroroDIV.Visible = true;
            lblErrorMsg.Text = "Error occured while update promotion status. Please contact your system administrator.";
            return;
        }

        //REMOVE THIS TASK FROM HR_MANGERS MAIL BOX

        NotificationManager notificationManager = new NotificationManager(promotionAssigment);
        TransactionResponse delteResponse = notificationManager.deleteNotificationForAssignedPromotion(Membership.GetUser());
        if (!delteResponse.isSuccessful())
        {
            //check if Warning Message is already logged, if so just add on it
            if (WarnDIV.Visible)
            {
                msgPanel.Visible = true;
                lblWarningMsg.Text = lblWarningMsg.Text + " and " + delteResponse.getMessage() + delteResponse.getErrorCode();
            }
            else
            {
                msgPanel.Visible = true;
                WarnDIV.Visible = true;
                lblWarningMsg.Text = delteResponse.getMessage() + delteResponse.getErrorCode();
            }
        }
        else
        {
            PanelConfirmVacancyComplete.Visible = false;
            msgPanel.Visible = true;
            SucessDIV.Visible = true;
            lblSuccessMessage.Text = "Operation Success!";


            btnAssignNew.Visible = false;
            btnAssignPromotion.Visible = true;

            populateAssignedPromotion();
            AssignPromotionPanel.Visible = true;
        }
    }
    protected void btnAssignPromotion_Click(object sender, EventArgs e)
    {
        clearMsgPanel();
        PromotionAssigment promotionAssigment = new PromotionAssigment();

        if (vaidateInputAndFillData(promotionAssigment))
        {
            PromotionManager promotionAssigmentManager = new PromotionManager(promotionAssigment);
            TransactionResponse response = promotionAssigmentManager.addNewPromotionAssignment();

            if (response.isSuccessful())
            {
                msgPanel.Visible = true;
                SucessDIV.Visible = true;
                lblSuccessMessage.Text = response.getMessage();

                AssignPromotionPanel.Visible = true;
                btnAssignNew.Visible = true;
                btnAssignPromotion.Visible = false;

                //REGISTER NOTIFICATION ABOUT THIS ASSIGNMENT TO HR OFFICER
                //HERE THE CIRRENT USER (i.e., HR Manager) IS THE SENDER AND HR OFFICERs ARE THE RECEIVERS
                NotificationManager notificationManager = new NotificationManager(promotionAssigment);
                TransactionResponse notificationResponse = notificationManager.addNotificationForPromotioAssignement(Membership.GetUser());
                if (!notificationResponse.isSuccessful())
                {
                    msgPanel.Visible = true;
                    WarnDIV.Visible = true;
                    lblWarningMsg.Text = notificationResponse.getMessage() + notificationResponse.getErrorCode();
                }

                //REMOVE THIS TASK FROM HR_MANGERS MAIL BOX
                TransactionResponse delteResponse = notificationManager.deleteNotificationForAssignedPromotion(Membership.GetUser());
                if (!delteResponse.isSuccessful())
                {
                    //check if Warning Message is already logged, if so just add on it
                    if (WarnDIV.Visible)
                    {
                        msgPanel.Visible = true;
                        lblWarningMsg.Text = lblWarningMsg.Text + " and " + delteResponse.getMessage() + delteResponse.getErrorCode();
                    }
                    else
                    {
                        msgPanel.Visible = true;
                        WarnDIV.Visible = true;
                        lblWarningMsg.Text = delteResponse.getMessage() + delteResponse.getErrorCode();
                    }
                }

                Promotion promotion = new Promotion();

                promotion.MinuteNo = promotionAssigment.MinuteNo;

                PromotionManager promotionManager = new PromotionManager(promotion);
                TransactionResponse promotionResponse = promotionManager.updatePromotionStatus(promotion, PromotionConstants.PROMOTION_ASSIGNED);

                if (!promotionResponse.isSuccessful())
                {
                    msgPanel.Visible = true;
                    ErroroDIV.Visible = true;
                    lblErrorMsg.Text = "Error occured while update promotion status. Please contact your system administrator.";
                    return;
                }
            }
            else
            {
                msgPanel.Visible = true;
                WarnDIV.Visible = true;
                lblWarningMsg.Text = response.getMessage() + response.getErrorCode();
            }
        }

    }