Property Controller - Endpoing error logg
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -25,6 +25,11 @@ namespace SocietyToolboxAPI.Controllers
|
||||
|
||||
DataTable dt = new DataTable();
|
||||
DataTable dtUtils = new DataTable();
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
int i = 0, j = 0;
|
||||
dt = DBProperty.getPropertyUnitList(PropertyID, PropertyUnitID);
|
||||
dtUtils = DBProperty.getPropertyUnilDetails(PropertyUnitID);
|
||||
@@ -86,46 +91,64 @@ namespace SocietyToolboxAPI.Controllers
|
||||
oReponse.Data = oData;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
oReponse.Status = "200";
|
||||
oReponse.Message = ex.Message;
|
||||
oReponse.Data = oData;
|
||||
}
|
||||
return oReponse;
|
||||
}
|
||||
|
||||
[Route("api/[controller]/GetPropertyUnitTypeList")]
|
||||
[HttpGet()]
|
||||
[HttpGet]
|
||||
public GetPropertyUnitTypeList GetPropertyUnitTypeList([FromQuery]int PropertyID)
|
||||
{
|
||||
GetPropertyUnitTypeList oReponse = new GetPropertyUnitTypeList();
|
||||
GetPropertyUnitTypeList oResponse = new GetPropertyUnitTypeList();
|
||||
List<PropertyUnitTypesModel> oData = new List<PropertyUnitTypesModel>();
|
||||
|
||||
DataTable dt = new DataTable();
|
||||
int i = 0;
|
||||
dt = DBProperty.getPropertyUnitTypeList(PropertyID);
|
||||
if (dt.Rows.Count > 0)
|
||||
try
|
||||
{
|
||||
for (i = 0; i <= dt.Rows.Count - 1; i++)
|
||||
|
||||
|
||||
int i = 0;
|
||||
dt = DBProperty.getPropertyUnitTypeList(PropertyID);
|
||||
|
||||
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
oData.Add(new PropertyUnitTypesModel
|
||||
for (i = 0; i <= dt.Rows.Count - 1; i++)
|
||||
{
|
||||
PropertyUnitTypeID = int.Parse(dt.Rows[i]["PropertyUnitTypeID"].ToString()),
|
||||
PropertyUnitTypeName = (dt.Rows[i]["PropertyUnitTypeName"].ToString()),
|
||||
oData.Add(new PropertyUnitTypesModel
|
||||
{
|
||||
PropertyUnitTypeID = int.Parse(dt.Rows[i]["PropertyUnitTypeID"].ToString()),
|
||||
PropertyUnitTypeName = (dt.Rows[i]["PropertyUnitTypeName"].ToString()),
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
oResponse.Status = "200";
|
||||
oResponse.Message = "Success";
|
||||
oResponse.Data = oData;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
oReponse.Status = "200";
|
||||
oReponse.Message = "Success";
|
||||
oReponse.Data = oData;
|
||||
oResponse.Status = "200";
|
||||
oResponse.Message = "No Records";
|
||||
oResponse.Data = oData;
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
oReponse.Status = "200";
|
||||
oReponse.Message = "No Records";
|
||||
oReponse.Data = oData;
|
||||
oResponse.Status = "500";
|
||||
oResponse.Message = ex.Message;
|
||||
oResponse.Data = oData;
|
||||
}
|
||||
|
||||
|
||||
return oReponse;
|
||||
return oResponse;
|
||||
}
|
||||
|
||||
[Route("api/[controller]/GetPropertyBuildingNoList")]
|
||||
@@ -166,63 +189,77 @@ namespace SocietyToolboxAPI.Controllers
|
||||
}
|
||||
|
||||
[Route("api/[controller]/GetPropertyUnitsForBuildingNo")]
|
||||
[HttpGet()]
|
||||
[HttpGet]
|
||||
public GetPropertyUnitList GetPropertyUnitsForBuildingNo([FromQuery]int PropertyID, [FromQuery]string BuildingNo)
|
||||
{
|
||||
GetPropertyUnitList oReponse = new GetPropertyUnitList();
|
||||
List<PropertyUnitsModel> oData = new List<PropertyUnitsModel>();
|
||||
|
||||
|
||||
DataTable dt = new DataTable();
|
||||
DataTable dtUtils = new DataTable();
|
||||
int i = 0;
|
||||
dt = DBProperty.getPropertyUnitForBuildingNo(PropertyID, BuildingNo);
|
||||
|
||||
if (dt.Rows.Count > 0)
|
||||
try
|
||||
{
|
||||
for (i = 0; i <= dt.Rows.Count - 1; i++)
|
||||
|
||||
|
||||
|
||||
int i = 0;
|
||||
dt = DBProperty.getPropertyUnitForBuildingNo(PropertyID, BuildingNo);
|
||||
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
List<PropertyUnitUtilitiesModel> oPropertyUtils = new List<PropertyUnitUtilitiesModel>();
|
||||
|
||||
oData.Add(new PropertyUnitsModel
|
||||
for (i = 0; i <= dt.Rows.Count - 1; i++)
|
||||
{
|
||||
PropertyUnitID = int.Parse(dt.Rows[i]["PropertyUnitID"].ToString()),
|
||||
PropertyID = int.Parse(dt.Rows[i]["PropertyID"].ToString()),
|
||||
PropertyUnitTypeID = int.Parse(dt.Rows[i]["PropertyUnitTypeID"].ToString()),
|
||||
PropertyUnitType = dt.Rows[i]["PropertyUnitType"].ToString(),
|
||||
UnitNo = dt.Rows[i]["UnitNo"].ToString(),
|
||||
UnitArea = decimal.Parse(dt.Rows[i]["UnitArea"].ToString()),
|
||||
UnitOpenArea = decimal.Parse(dt.Rows[i]["UnitOpenArea"].ToString()),
|
||||
BuildingNo = dt.Rows[i]["BuildingNo"].ToString(),
|
||||
ParkingNo = dt.Rows[i]["ParkingNo"].ToString(),
|
||||
NoofParkings = int.Parse(dt.Rows[i]["NoofParkings"].ToString()),
|
||||
ShareCertificateNos = dt.Rows[i]["ShareCertificateNos"].ToString(),
|
||||
CertificateNo = (dt.Rows[i]["CertificateNo"].ToString()),
|
||||
MemberID = int.Parse(dt.Rows[i]["MemberID"].ToString()),
|
||||
MemberName = dt.Rows[i]["MemberName"].ToString(),
|
||||
FirstOwnerName = dt.Rows[i]["FirstOwnerName"].ToString(),
|
||||
SecondOwnerName = dt.Rows[i]["SecondOwnerName"].ToString(),
|
||||
NomineeName = dt.Rows[i]["NomineeName"].ToString(),
|
||||
OpeningBalance = decimal.Parse(dt.Rows[i]["OpeningBalance"].ToString()),
|
||||
RentedAmount = 0,
|
||||
PropertyUnitUtilities = oPropertyUtils
|
||||
List<PropertyUnitUtilitiesModel> oPropertyUtils = new List<PropertyUnitUtilitiesModel>();
|
||||
|
||||
oData.Add(new PropertyUnitsModel
|
||||
{
|
||||
PropertyUnitID = int.Parse(dt.Rows[i]["PropertyUnitID"].ToString()),
|
||||
PropertyID = int.Parse(dt.Rows[i]["PropertyID"].ToString()),
|
||||
PropertyUnitTypeID = int.Parse(dt.Rows[i]["PropertyUnitTypeID"].ToString()),
|
||||
PropertyUnitType = dt.Rows[i]["PropertyUnitType"].ToString(),
|
||||
UnitNo = dt.Rows[i]["UnitNo"].ToString(),
|
||||
UnitArea = decimal.Parse(dt.Rows[i]["UnitArea"].ToString()),
|
||||
UnitOpenArea = decimal.Parse(dt.Rows[i]["UnitOpenArea"].ToString()),
|
||||
BuildingNo = dt.Rows[i]["BuildingNo"].ToString(),
|
||||
ParkingNo = dt.Rows[i]["ParkingNo"].ToString(),
|
||||
NoofParkings = int.Parse(dt.Rows[i]["NoofParkings"].ToString()),
|
||||
ShareCertificateNos = dt.Rows[i]["ShareCertificateNos"].ToString(),
|
||||
CertificateNo = (dt.Rows[i]["CertificateNo"].ToString()),
|
||||
MemberID = int.Parse(dt.Rows[i]["MemberID"].ToString()),
|
||||
MemberName = dt.Rows[i]["MemberName"].ToString(),
|
||||
FirstOwnerName = dt.Rows[i]["FirstOwnerName"].ToString(),
|
||||
SecondOwnerName = dt.Rows[i]["SecondOwnerName"].ToString(),
|
||||
NomineeName = dt.Rows[i]["NomineeName"].ToString(),
|
||||
OpeningBalance = decimal.Parse(dt.Rows[i]["OpeningBalance"].ToString()),
|
||||
RentedAmount = 0,
|
||||
PropertyUnitUtilities = oPropertyUtils
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
oReponse.Status = "200";
|
||||
oReponse.Message = "Success";
|
||||
oReponse.Data = oData;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
oReponse.Status = "200";
|
||||
oReponse.Message = "Success";
|
||||
oReponse.Data = oData;
|
||||
oReponse.Status = "200";
|
||||
oReponse.Message = "No Records";
|
||||
oReponse.Data = oData;
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
oReponse.Status = "200";
|
||||
oReponse.Message = "No Records";
|
||||
oReponse.Message = ex.Message;
|
||||
oReponse.Data = oData;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return oReponse;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user