public static int Update(BOEmployeeDetails entry)
 {
     return tblEmployeeDetailsDBManager.Save(entry, false);
 }
 public static int Save(BOEmployeeDetails entry)
 {
     return tblEmployeeDetailsDBManager.Save(entry, true);
 }
      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)
 {
     return tblEmployeeDetailsDBManager.Save(entry, adding);
 }
 private static BOEmployeeDetails FillDataRecord(DataRow dr)
 {
     BOEmployeeDetails itemObj = new BOEmployeeDetails();
     if(dr["EmployeeDetailsID"] != DBNull.Value)
         itemObj.EmployeeDetailsID = Int32.Parse(dr["EmployeeDetailsID"].ToString());
     if(dr["EmpProfileImage"] != DBNull.Value)
         itemObj.EmpProfileImage = dr["EmpProfileImage"].ToString();
     if(dr["EmployeeID"] != DBNull.Value)
         itemObj.EmployeeID = Int32.Parse(dr["EmployeeID"].ToString());
     if(dr["gender"] != DBNull.Value)
         itemObj.gender = dr["gender"].ToString();
     if(dr["MaritalStatus"] != DBNull.Value)
         itemObj.MaritalStatus = dr["MaritalStatus"].ToString();
     if(dr["DateOfBirth"] != DBNull.Value)
         itemObj.DateOfBirth = DateTime.Parse(dr["DateOfBirth"].ToString());
     if(dr["DateOfAniversary"] != DBNull.Value)
         itemObj.DateOfAniversary = DateTime.Parse(dr["DateOfAniversary"].ToString());
     if(dr["ContactNumber"] != DBNull.Value)
         itemObj.ContactNumber = Int32.Parse(dr["ContactNumber"].ToString());
     if(dr["Landline"] != DBNull.Value)
         itemObj.Landline = Int32.Parse(dr["Landline"].ToString());
     if(dr["CompanyProfile"] != DBNull.Value)
         itemObj.CompanyProfile = dr["CompanyProfile"].ToString();
     if(dr["JoinningDate"] != DBNull.Value)
         itemObj.JoinningDate = DateTime.Parse(dr["JoinningDate"].ToString());
     if(dr["CreatedOn"] != DBNull.Value)
         itemObj.CreatedOn = DateTime.Parse(dr["CreatedOn"].ToString());
     if(dr["CreatedByID"] != DBNull.Value)
         itemObj.CreatedByID = Int32.Parse(dr["CreatedByID"].ToString());
     if(dr["ModifiedOn"] != DBNull.Value)
         itemObj.ModifiedOn = DateTime.Parse(dr["ModifiedOn"].ToString());
     if(dr["ModifiedByID"] != DBNull.Value)
         itemObj.ModifiedByID = Int32.Parse(dr["ModifiedByID"].ToString());
     if(dr["IsActive"] != DBNull.Value)
         itemObj.IsActive = Boolean.Parse(dr["IsActive"].ToString());
     return itemObj;
 }