private void LoadTargetDist()
 {
     try
     {
         if (TargetID != -1)
         {
             if (targetAlreadyExists())
             {
                 btnSave.Text = "Edit";
             }
             else
             {
                 btnSave.Text = "Save";
             }
             BranchID = getBranchIDfromUser();
             SalesBranchTarget salesBranchTarget = getBranchTarget();//must load TargetID and BranchID first
             if (salesBranchTarget == null)
             {
                 TargetAmount     = 0;
                 TargetCurrencyID = -1;
             }
             else
             {
                 TargetAmount     = (double)salesBranchTarget.Amount;
                 TargetCurrencyID = salesBranchTarget.CurrencyID;
             }
             lblBranchTarget.Text = TargetAmount.ToString();
             //string targetIDs = getLast5YearsTargetIDs();
             string    salesMenIDs         = getAllSalesMenIDs();
             string    salesMenInBranchIDs = getMyBranchSalesMenIDs(salesMenIDs);
             DataTable userLastTargets     = getLastUserTargets(salesMenInBranchIDs, BranchID);
             if (salesMenIDs != "")
             {
                 LoadSalesMenTable(salesMenIDs, userLastTargets);
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(Page, typeof(Page),
                                                 "NoTarget", "alert('Target is invalid!');", true);
         }
     }
     catch (Exception ex)
     {
         //Logger.LogException(ex);
     }
 }
    public void AddProgress()
    {
        if (CurrentAmount < TargetAmount)
        {
            CurrentAmount++;
        }

        if (TargetAmount != 0)
        {
            progressText.text = CurrentAmount.ToString() + "/" + TargetAmount.ToString();
        }

        if (CurrentAmount == TargetAmount) //task is complete
        {
            QuestManager.Current.DisplayCompleteTask(this);
            Completed         = true;
            canvasGroup.alpha = 0.5f;
        }

        else if (TargetAmount != 0) //if not complete, just show update
        {
            QuestManager.Current.DisplayUpdateTask(this);
        }
    }