/// <summary>
 /// return the time activity from sql
 /// </summary>
 /// <param name="timeActivitydto"></param>
 /// <returns></returns>
 private List<TimeActivityFill> GetTimeActivityFromDb(TimeActivitydto timeActivitydto)
 {
     List<TimeActivityFill> fillList = new List<TimeActivityFill>();
     using (SqlConnection sqlConnection = new SqlConnection(timeActivitydto.Syncdto.ConnectionString))
     {
         string oString = "Select * from TimeActivity";
         SqlCommand oCmd = new SqlCommand(oString, sqlConnection);
         sqlConnection.Open();
         using (SqlDataReader oReader = oCmd.ExecuteReader())
         {
             while (oReader.Read())
             {
                 TimeActivityFill timeActivityFill = new TimeActivityFill();
                 timeActivityFill.Employee = oReader["Employee"].ToString();
                 timeActivityFill.Customer = oReader["Customer"].ToString();
                 timeActivityFill.Item = oReader["Item"].ToString();
                 timeActivityFill.Date = oReader["Date"].ToString();
                 timeActivityFill.Hours = oReader["Hours"].ToString();
                 timeActivityFill.QboId = oReader["QboId"].ToString();
                 fillList.Add(timeActivityFill);
             }
             sqlConnection.Close();
         }
     }
     return fillList;
 }
 /// <summary>
 /// Populate the invoice left for pending.
 /// </summary>
 /// <param name="invoicedto"></param>
 /// <returns></returns>
 internal Invoicedto LoadPending(Invoicedto invoicedto)
 {
     List<TimeActivityFill> timeActivityFillList = new List<TimeActivityFill>();
     using (SqlConnection sqlConnection = new SqlConnection(invoicedto.ConnectionString))
     {
         string oString = string.Format("select * from TimeActivity where RealmId='{0}' and Invoice_QboId is null", invoicedto.CompanyId);
         SqlCommand oCmd = new SqlCommand(oString, sqlConnection);
         sqlConnection.Open();
         using (SqlDataReader oReader = oCmd.ExecuteReader())
         {
             while (oReader.Read())
             {
                 TimeActivityFill timeActivityFill = new TimeActivityFill();
                 timeActivityFill.Employee = oReader["Employee"].ToString();
                 timeActivityFill.Customer = oReader["Customer"].ToString();
                 timeActivityFill.Item = oReader["Item"].ToString();
                 timeActivityFill.Date = Convert.ToDateTime(oReader["Date"].ToString()).ToShortDateString();
                 timeActivityFill.Hours = oReader["Hours"].ToString();
                 timeActivityFill.QboId = oReader["QboId"].ToString();
                 timeActivityFillList.Add(timeActivityFill);
             }
             sqlConnection.Close();
         }
     }
     if (invoicedto.InvoiceCreated==null)
     {
         invoicedto.InvoiceCreated = new List<InvoiceCreated>();
     }
     invoicedto.InvoicePending = "Pending";
     invoicedto.InvoicePendingLength = timeActivityFillList.Count;
     invoicedto.InvoicePendingList = timeActivityFillList;
     return invoicedto;
 }