public static BOEmployeeDetailsList GetAllList(int startIndex, int length, string whereClause) { BOEmployeeDetailsList itemObjs = null; tblEmployeeDetails tblObj = new tblEmployeeDetails(); DataTable dt = tblObj.GetAllData(startIndex, length, whereClause, null); if (dt.Rows.Count > 0) { itemObjs = new BOEmployeeDetailsList(); foreach(DataRow dr in dt.Rows) { itemObjs.Add(FillDataRecord(dr)); } } return itemObjs; }
public static BOEmployeeDetailsList GetAllList() { BOEmployeeDetailsList itemObjs = null; tblEmployeeDetails tblObj = new tblEmployeeDetails(); DataTable dt = tblObj.GetAllData(); if (dt.Rows.Count > 0) { itemObjs = new BOEmployeeDetailsList(); foreach(DataRow dr in dt.Rows) { itemObjs.Add(FillDataRecord(dr)); } } return itemObjs; }
public static BOEmployeeDetailsList GetAllList(int startIndex, int length, string whereClause) { BOEmployeeDetailsList itemObjs = null; tblEmployeeDetails tblObj = new tblEmployeeDetails(); DataTable dt = tblObj.GetAllData(startIndex, length, whereClause, null); if (dt.Rows.Count > 0) { itemObjs = new BOEmployeeDetailsList(); foreach (DataRow dr in dt.Rows) { itemObjs.Add(FillDataRecord(dr)); } } return(itemObjs); }
public static BOEmployeeDetailsList GetAllList() { BOEmployeeDetailsList itemObjs = null; tblEmployeeDetails tblObj = new tblEmployeeDetails(); DataTable dt = tblObj.GetAllData(); if (dt.Rows.Count > 0) { itemObjs = new BOEmployeeDetailsList(); foreach (DataRow dr in dt.Rows) { itemObjs.Add(FillDataRecord(dr)); } } return(itemObjs); }
public static int Save(BOEmployeeDetailsList list, bool adding) { return(tblEmployeeDetailsDBManager.Save(list, adding)); }
public static int Save(BOEmployeeDetailsList list, bool adding) { return tblEmployeeDetailsDBManager.Save(list,adding); }
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(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); }