Example #1
0
 public static int Update(BOHolidayDetails entry)
 {
    return tblHolidayDetailsDBManager.Save(entry, false);
 }
Example #2
0
 public static int Save(BOHolidayDetails entry)
 {
    return tblHolidayDetailsDBManager.Save(entry, true);
 }
      public static int Save(BOHolidayDetails entry, bool adding)
      {
          tblHolidayDetails tblObj = new tblHolidayDetails();
          DataRow newRow = tblObj.Table().NewRow();

              newRow[tblHolidayDetails.HOLIDAYID_FIELD] = entry.HolidayID;
              newRow[tblHolidayDetails.HOLIDAYTYPE_FIELD] = entry.HolidayType;
              if(entry.HolidayDate.Equals(new DateTime()))
                  newRow[tblHolidayDetails.HOLIDAYDATE_FIELD] = DBNull.Value;
              else
                  newRow[tblHolidayDetails.HOLIDAYDATE_FIELD] = entry.HolidayDate;

          if(adding)
              return tblObj.AddToTable(newRow);
          else
              return tblObj.UpdateTable(newRow);
      }
Example #4
0
 public static int Save(BOHolidayDetails entry, bool adding)
 {
    return tblHolidayDetailsDBManager.Save(entry, adding);
 }
 private static BOHolidayDetails FillDataRecord(DataRow dr)
 {
     BOHolidayDetails itemObj = new BOHolidayDetails();
     if(dr["HolidayID"] != DBNull.Value)
         itemObj.HolidayID = Int32.Parse(dr["HolidayID"].ToString());
     if(dr["HolidayType"] != DBNull.Value)
         itemObj.HolidayType = dr["HolidayType"].ToString();
     if(dr["HolidayDate"] != DBNull.Value)
         itemObj.HolidayDate = DateTime.Parse(dr["HolidayDate"].ToString());
     return itemObj;
 }