Hi Team,
I have the code which is working.In my code there are if condition is available ,I want to implement one more If condition in exiting if condition.My Condition is as follows:
I am reading the values from excel sheet .In excel there are number of rows and columns.I have CellId,route ,place,mobilenumber ..and so on as a column name in my excel file.
for example: In Cellid column, value are 123 ,other columns are having some value related to particular record for one row
for second row,In CellID column,value are 123 but other column are null.So in this senario,I want to check the record if same number of cellid exsist then read the record in which value are present in columns not to read the value in which cellid is present but other columns are null. How can i implement this in if condition.Please guide me.
public IEntityCollectionBase GetZteBbhRecords(IEntityBase xmlConfiguration)
{
IDataReader dataReader = null;
ExcelDataAccess excelDataAccess = null;
IEntityCollectionBase zteBbhRecords = Kaizen2GEntityCreator.GetZteBbhEntityCollection();
try
{
IXmlConfiguration xmlConfig = xmlConfiguration as IXmlConfiguration;
Logger.Write("Inside ZteBbhDataManager.GetZteBbhRecords()", xmlConfig.LogTypeInfo);
excelDataAccess = CommonDataManager.GetDataAccess(xmlConfig);
dataReader = excelDataAccess.ExecuteReader();
IZteBbh zteBbhEntity = null;
while (dataReader.Read())
{
zteBbhEntity = Kaizen2GEntityCreator.GetZteBbhEntity();
zteBbhEntity = CommonDataManager.GetEntityFromExcelRow(dataReader, xmlConfig, zteBbhEntity) as IZteBbh;
if (zteBbhEntity != null)
{
if ((zteBbhEntity.CombinedMaster as ICombinedMaster).CellId > 0)
{
if ((zteBbhEntity.CombinedMaster as ICombinedMaster).Circle.Trim().ToUpper() == "ROTN")
{
(zteBbhEntity.CombinedMaster as ICombinedMaster).Circle = "ROTN-ZTE";
}
else if ((zteBbhEntity.CombinedMaster as ICombinedMaster).Circle.Trim().ToUpper() == "AP")
{
(zteBbhEntity.CombinedMaster as ICombinedMaster).Circle = "AP-ZTE";
}
zteBbhEntity.FileLogId = xmlConfig.FileLogId;
zteBbhEntity.HandOverSuccessRate = zteBbhEntity.HandOverSuccessRate * 100;
zteBbhEntity.HandOverFailureRate = zteBbhEntity.HandOverFailureRate * 100;
zteBbhEntity.RandomAccessSuccessRate = zteBbhEntity.RandomAccessSuccessRate * 100;
zteBbhEntity.TbfSuccessRateUl = zteBbhEntity.TbfSuccessRateUl * 100;
zteBbhEntity.TbfSuccessRateDl = zteBbhEntity.TbfSuccessRateDl * 100;
zteBbhRecords.Add(zteBbhEntity);
}
}
}
Logger.Write("Exiting ZteBbhDataManager.GetZteBbhRecords()", xmlConfig.LogTypeInfo);
}
catch (Exception exception)
{
throw exception;
}
finally
{
dataReader.CloseDataReader();
excelDataAccess.CloseConnection();
}
return zteBbhRecords;
}
indenting reduced