Ejemplo n.º 1
0
 /// <summary>
 /// Loads a Voulenteer with the id
 /// </summary>
 /// <param name="volId">Id to load</param>
 /// <param name="volInfo">The info to set it to</param>
 public void loadVolInfo(int volId, HDVolContactInfo volInfo)
 {
     volInfo.reset();
     if ((volId > 0) && (clsVol.open(volId) == true))
     {
         volInfo.id    = volId;
         volInfo.name  = clsVol.Name;
         volInfo.phone = clsVol.Phone;
     }
 }
Ejemplo n.º 2
0
 public void loadDriverInfo(int volId)
 {
     driverName  = "";
     driverPhone = "";
     if (volId > 0)
     {
         Volunteers clsVol = new Volunteers(connString);
         if (clsVol.open(volId) == true)
         {
             driverName  = clsVol.Name;
             driverPhone = clsVol.Phone;
         }
     }
 }
Ejemplo n.º 3
0
 private bool LoadVolunteer(string testVolId, string testDate)
 {
     if (testVolId != "")
     {
         if (clsVols.open(Convert.ToInt32(testVolId)) == true)
         {
             lblName.Text = clsVols.Name;
             clsVolHrs.openWhere("WHERE VolID = " + testVolId + " AND TrxDate = '" + testDate + "'");
             if (clsVolHrs.IsValid == false) //no record means checkin
             {
                 modeTimeIN    = true;
                 tbTimeIN.Tag  = DateTime.Now.ToShortTimeString();
                 tbTimeIN.Text = tbTimeIN.Tag.ToString();
             }
             else
             {
                 modeTimeIN   = false;
                 tbTimeIN.Tag = clsVolHrs.VolTimeIn;
                 string tmp = "01/01/2010 " + tbTimeIN.Tag;
                 tbTimeIN.Text = Convert.ToDateTime(tmp).ToShortTimeString();
                 if (clsVolHrs.VolTimeOut == "")
                 {
                     tbTimeOUT.Tag = DateTime.Now.ToShortTimeString();
                 }
                 else
                 {
                     tbTimeOUT.Tag = clsVolHrs.VolTimeOut;
                 }
                 tmp            = "01/01/2010 " + tbTimeOUT.Tag;
                 tbTimeOUT.Text = Convert.ToDateTime(tmp).ToShortTimeString();
                 tbHours.Tag    = clsVolHrs.TotalHours(tbTimeIN.Tag.ToString(), tbTimeOUT.Tag.ToString());
                 formattedHours();
             }
             return(true);
         }
         else
         {
             MessageBox.Show("I cannot find this Volunteer\r\nID: " + testVolId, "Find Volunteer Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     return(false);
 }