public eTrainingOfflineEntities getTrainingOfflineCenterInfo() { string providerName = "System.Data.SqlClient"; ConnectionEntity objEntity = getConnEntityOfflineInfo(); SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder(); sqlBuilder.DataSource = objEntity.serverName; sqlBuilder.InitialCatalog = objEntity.databaseName; sqlBuilder.UserID = objEntity.userName; sqlBuilder.Password = objEntity.password; sqlBuilder.MultipleActiveResultSets = true; string providerString = sqlBuilder.ToString(); EntityConnectionStringBuilder objEcsb = new EntityConnectionStringBuilder(); objEcsb.Provider = providerName; objEcsb.ProviderConnectionString = providerString; //objEcsb.Metadata = @"res://*/eCenterTrainning.csdl|res://*/eCenterTrainningOffline.ssdl|res://*/eCenterTrainningOffline.msl"; objEcsb.Metadata = @"res://*/eTrainingOfflineModel.csdl|res://*/eTrainingOfflineModel.ssdl|res://*/eTrainingOfflineModel.msl"; EntityConnection objConnection = new EntityConnection(objEcsb.ToString()); //TrainingCenterOfflineEntities objTraining = new TrainingCenterOfflineEntities(objConnection.ToString()); eTrainingOfflineEntities objTraining = new eTrainingOfflineEntities(objEcsb.ToString()); return(objTraining); }
public eTrainingOfflineEntities getTrainingCenterOff() { Common objCommon = new Common(); eTrainingOfflineEntities objTraining = objCommon.getTrainingOfflineCenterInfo(); return(objTraining); }
public List <StudentObject> GetOffline() { List <StudentObject> listStudentOffline = new List <StudentObject>(); ConnectionEntities objConEn = new ConnectionEntities(); eTrainingOfflineEntities objConnEntitiesOff = objConEn.getTrainingCenterOff(); var listTempOffline = objConnEntitiesOff.SP_Student_GetOfflineStudentFromLast3days(); foreach (var item in listTempOffline) { StudentObject objS = new StudentObject(item.Id, item.FirstName, item.LastName, item.FullName, item.Sex, item.DateBirthday, item.Mobile, item.Email, item.Address, item.DateCreate, item.DateLastUpdate, item.Description, item.CourseId, item.StatusId, item.UserId); listStudentOffline.Add(objS); } return(listStudentOffline); }