//public void setDropdownlist(DropDownList ddl,string value)
    //{
    //    if (value == "")
    //    {
    //        ListItem Litem = new ListItem("--Select--","0");
    //        ddl.Items.Add(Litem);
    //        //ddl.DataBind();
    //    }
    //    else
    //    {
    //        ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByValue(value));
    //    }
    //}
    
    public void InsertAppTrail()
    {

        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        LoanDS.LoanApplicationsDataTable tblLoanApp = loanApp.GetLoanApplication(MySessionManager.AppID.ToString());
        int pastUser = Convert.ToInt32(loanApp.GetPreviousUsersID(MySessionManager.AppID)); 

        TimeSpan  TimeDiff =(DateTime.Now - tblLoanApp[0].datMoveTime);
        string moveTime = TimeDiff.Days + " days " + TimeDiff.Hours + " hours" + TimeDiff.Minutes + " minutes and " + TimeDiff.Seconds+" seconds"; 
        int stage = Convert.ToInt32(loanApp.getApplicationStatus(MySessionManager.AppID));

        try
        {
            LoanDSTableAdapters.ApplicationTrailTableAdapter AppTrail = new LoanDSTableAdapters.ApplicationTrailTableAdapter();
            AppTrail.InsertAppTrail(MySessionManager.AppID,
                                    pastUser,
                                    MySessionManager.CurrentUser.UserID,
                                    tblLoanApp[0].datMoveTime,
                                    stage,
                                    moveTime);


            loanApp.SetNewUserAndTime(MySessionManager.CurrentUser.UserID, DateTime.Now, MySessionManager.AppID);
        }
        catch (Exception ex) { }
    }