public static int Save(BOEmployeeDetailsList entryList, bool adding)
        {
            tblEmployeeDetails tblObj = new tblEmployeeDetails();
            DataTable          dt     = tblObj.Table();
            int i = 0;

            foreach (BOEmployeeDetails entry in entryList)
            {
                DataRow newRow = tblObj.Table().NewRow();

                newRow[tblEmployeeDetails.EMPPROFILEIMAGE_FIELD] = entry.EmpProfileImage;
                newRow[tblEmployeeDetails.EMPLOYEEID_FIELD]      = entry.EmployeeID;
                newRow[tblEmployeeDetails.GENDER_FIELD]          = entry.gender;
                newRow[tblEmployeeDetails.MARITALSTATUS_FIELD]   = entry.MaritalStatus;
                if (entry.DateOfBirth.Equals(new DateTime()))
                {
                    newRow[tblEmployeeDetails.DATEOFBIRTH_FIELD] = DBNull.Value;
                }
                else
                {
                    newRow[tblEmployeeDetails.DATEOFBIRTH_FIELD] = entry.DateOfBirth;
                }
                if (entry.DateOfAniversary.Equals(new DateTime()))
                {
                    newRow[tblEmployeeDetails.DATEOFANIVERSARY_FIELD] = DBNull.Value;
                }
                else
                {
                    newRow[tblEmployeeDetails.DATEOFANIVERSARY_FIELD] = entry.DateOfAniversary;
                }
                newRow[tblEmployeeDetails.CONTACTNUMBER_FIELD]  = entry.ContactNumber;
                newRow[tblEmployeeDetails.LANDLINE_FIELD]       = entry.Landline;
                newRow[tblEmployeeDetails.COMPANYPROFILE_FIELD] = entry.CompanyProfile;
                if (entry.JoinningDate.Equals(new DateTime()))
                {
                    newRow[tblEmployeeDetails.JOINNINGDATE_FIELD] = DBNull.Value;
                }
                else
                {
                    newRow[tblEmployeeDetails.JOINNINGDATE_FIELD] = entry.JoinningDate;
                }
                if (entry.CreatedOn.Equals(new DateTime()))
                {
                    newRow[tblEmployeeDetails.CREATEDON_FIELD] = DBNull.Value;
                }
                else
                {
                    newRow[tblEmployeeDetails.CREATEDON_FIELD] = entry.CreatedOn;
                }
                newRow[tblEmployeeDetails.CREATEDBYID_FIELD] = entry.CreatedByID;
                if (entry.ModifiedOn.Equals(new DateTime()))
                {
                    newRow[tblEmployeeDetails.MODIFIEDON_FIELD] = DBNull.Value;
                }
                else
                {
                    newRow[tblEmployeeDetails.MODIFIEDON_FIELD] = entry.ModifiedOn;
                }
                newRow[tblEmployeeDetails.MODIFIEDBYID_FIELD] = entry.ModifiedByID;
                newRow[tblEmployeeDetails.ISACTIVE_FIELD]     = entry.IsActive;

                dt.Rows.Add(newRow);
                i++;
            }

            //if(adding): Commented out at the moment. KS 28th Aug 2012
            return(tblObj.AddToTable(dt));
            //else
            //return tblObj.UpdateTable(dt);
        }
      public static int Save(BOEmployeeDetails entry, bool adding)
      {
          tblEmployeeDetails tblObj = new tblEmployeeDetails();
          DataRow newRow = tblObj.Table().NewRow();

              newRow[tblEmployeeDetails.EMPLOYEEDETAILSID_FIELD] = entry.EmployeeDetailsID;
              newRow[tblEmployeeDetails.EMPPROFILEIMAGE_FIELD] = entry.EmpProfileImage;
              newRow[tblEmployeeDetails.EMPLOYEEID_FIELD] = entry.EmployeeID;
              newRow[tblEmployeeDetails.GENDER_FIELD] = entry.gender;
              newRow[tblEmployeeDetails.MARITALSTATUS_FIELD] = entry.MaritalStatus;
              if(entry.DateOfBirth.Equals(new DateTime()))
                  newRow[tblEmployeeDetails.DATEOFBIRTH_FIELD] = DBNull.Value;
              else
                  newRow[tblEmployeeDetails.DATEOFBIRTH_FIELD] = entry.DateOfBirth;
              if(entry.DateOfAniversary.Equals(new DateTime()))
                  newRow[tblEmployeeDetails.DATEOFANIVERSARY_FIELD] = DBNull.Value;
              else
                  newRow[tblEmployeeDetails.DATEOFANIVERSARY_FIELD] = entry.DateOfAniversary;
              newRow[tblEmployeeDetails.CONTACTNUMBER_FIELD] = entry.ContactNumber;
              newRow[tblEmployeeDetails.LANDLINE_FIELD] = entry.Landline;
              newRow[tblEmployeeDetails.COMPANYPROFILE_FIELD] = entry.CompanyProfile;
              if(entry.JoinningDate.Equals(new DateTime()))
                  newRow[tblEmployeeDetails.JOINNINGDATE_FIELD] = DBNull.Value;
              else
                  newRow[tblEmployeeDetails.JOINNINGDATE_FIELD] = entry.JoinningDate;
              if(entry.CreatedOn.Equals(new DateTime()))
                  newRow[tblEmployeeDetails.CREATEDON_FIELD] = DBNull.Value;
              else
                  newRow[tblEmployeeDetails.CREATEDON_FIELD] = entry.CreatedOn;
              newRow[tblEmployeeDetails.CREATEDBYID_FIELD] = entry.CreatedByID;
              if(entry.ModifiedOn.Equals(new DateTime()))
                  newRow[tblEmployeeDetails.MODIFIEDON_FIELD] = DBNull.Value;
              else
                  newRow[tblEmployeeDetails.MODIFIEDON_FIELD] = entry.ModifiedOn;
              newRow[tblEmployeeDetails.MODIFIEDBYID_FIELD] = entry.ModifiedByID;
              newRow[tblEmployeeDetails.ISACTIVE_FIELD] = entry.IsActive;

          if(adding)
              return tblObj.AddToTable(newRow);
          else
              return tblObj.UpdateTable(newRow);
      }
        public static int Save(BOEmployeeDetails entry, bool adding)
        {
            tblEmployeeDetails tblObj = new tblEmployeeDetails();
            DataRow            newRow = tblObj.Table().NewRow();

            newRow[tblEmployeeDetails.EMPLOYEEDETAILSID_FIELD] = entry.EmployeeDetailsID;
            newRow[tblEmployeeDetails.EMPPROFILEIMAGE_FIELD]   = entry.EmpProfileImage;
            newRow[tblEmployeeDetails.EMPLOYEEID_FIELD]        = entry.EmployeeID;
            newRow[tblEmployeeDetails.GENDER_FIELD]            = entry.gender;
            newRow[tblEmployeeDetails.MARITALSTATUS_FIELD]     = entry.MaritalStatus;
            if (entry.DateOfBirth.Equals(new DateTime()))
            {
                newRow[tblEmployeeDetails.DATEOFBIRTH_FIELD] = DBNull.Value;
            }
            else
            {
                newRow[tblEmployeeDetails.DATEOFBIRTH_FIELD] = entry.DateOfBirth;
            }
            if (entry.DateOfAniversary.Equals(new DateTime()))
            {
                newRow[tblEmployeeDetails.DATEOFANIVERSARY_FIELD] = DBNull.Value;
            }
            else
            {
                newRow[tblEmployeeDetails.DATEOFANIVERSARY_FIELD] = entry.DateOfAniversary;
            }
            newRow[tblEmployeeDetails.CONTACTNUMBER_FIELD]  = entry.ContactNumber;
            newRow[tblEmployeeDetails.LANDLINE_FIELD]       = entry.Landline;
            newRow[tblEmployeeDetails.COMPANYPROFILE_FIELD] = entry.CompanyProfile;
            if (entry.JoinningDate.Equals(new DateTime()))
            {
                newRow[tblEmployeeDetails.JOINNINGDATE_FIELD] = DBNull.Value;
            }
            else
            {
                newRow[tblEmployeeDetails.JOINNINGDATE_FIELD] = entry.JoinningDate;
            }
            if (entry.CreatedOn.Equals(new DateTime()))
            {
                newRow[tblEmployeeDetails.CREATEDON_FIELD] = DBNull.Value;
            }
            else
            {
                newRow[tblEmployeeDetails.CREATEDON_FIELD] = entry.CreatedOn;
            }
            newRow[tblEmployeeDetails.CREATEDBYID_FIELD] = entry.CreatedByID;
            if (entry.ModifiedOn.Equals(new DateTime()))
            {
                newRow[tblEmployeeDetails.MODIFIEDON_FIELD] = DBNull.Value;
            }
            else
            {
                newRow[tblEmployeeDetails.MODIFIEDON_FIELD] = entry.ModifiedOn;
            }
            newRow[tblEmployeeDetails.MODIFIEDBYID_FIELD] = entry.ModifiedByID;
            newRow[tblEmployeeDetails.ISACTIVE_FIELD]     = entry.IsActive;

            if (adding)
            {
                return(tblObj.AddToTable(newRow));
            }
            else
            {
                return(tblObj.UpdateTable(newRow));
            }
        }
      public static int Save(BOEmployeeDetailsList entryList, bool adding)
      {
          tblEmployeeDetails tblObj = new tblEmployeeDetails();
          DataTable dt = tblObj.Table();
          int i = 0;

          foreach(BOEmployeeDetails entry in entryList)
          {
              DataRow newRow = tblObj.Table().NewRow();

              newRow[tblEmployeeDetails.EMPPROFILEIMAGE_FIELD] = entry.EmpProfileImage;
              newRow[tblEmployeeDetails.EMPLOYEEID_FIELD] = entry.EmployeeID;
              newRow[tblEmployeeDetails.GENDER_FIELD] = entry.gender;
              newRow[tblEmployeeDetails.MARITALSTATUS_FIELD] = entry.MaritalStatus;
          if(entry.DateOfBirth.Equals(new DateTime()))
              newRow[tblEmployeeDetails.DATEOFBIRTH_FIELD] = DBNull.Value;
          else
              newRow[tblEmployeeDetails.DATEOFBIRTH_FIELD] = entry.DateOfBirth;
          if(entry.DateOfAniversary.Equals(new DateTime()))
              newRow[tblEmployeeDetails.DATEOFANIVERSARY_FIELD] = DBNull.Value;
          else
              newRow[tblEmployeeDetails.DATEOFANIVERSARY_FIELD] = entry.DateOfAniversary;
              newRow[tblEmployeeDetails.CONTACTNUMBER_FIELD] = entry.ContactNumber;
              newRow[tblEmployeeDetails.LANDLINE_FIELD] = entry.Landline;
              newRow[tblEmployeeDetails.COMPANYPROFILE_FIELD] = entry.CompanyProfile;
          if(entry.JoinningDate.Equals(new DateTime()))
              newRow[tblEmployeeDetails.JOINNINGDATE_FIELD] = DBNull.Value;
          else
              newRow[tblEmployeeDetails.JOINNINGDATE_FIELD] = entry.JoinningDate;
          if(entry.CreatedOn.Equals(new DateTime()))
              newRow[tblEmployeeDetails.CREATEDON_FIELD] = DBNull.Value;
          else
              newRow[tblEmployeeDetails.CREATEDON_FIELD] = entry.CreatedOn;
              newRow[tblEmployeeDetails.CREATEDBYID_FIELD] = entry.CreatedByID;
          if(entry.ModifiedOn.Equals(new DateTime()))
              newRow[tblEmployeeDetails.MODIFIEDON_FIELD] = DBNull.Value;
          else
              newRow[tblEmployeeDetails.MODIFIEDON_FIELD] = entry.ModifiedOn;
              newRow[tblEmployeeDetails.MODIFIEDBYID_FIELD] = entry.ModifiedByID;
              newRow[tblEmployeeDetails.ISACTIVE_FIELD] = entry.IsActive;

              dt.Rows.Add(newRow);
              i++;
          }

          //if(adding): Commented out at the moment. KS 28th Aug 2012
              return tblObj.AddToTable(dt);
          //else
              //return tblObj.UpdateTable(dt);
      }