User1312693872 posted
Hi,jagjit saini
jagjit saini
How i can use these 2 methods in GetAllLocation
What do you mean about use these 2 methods in GetAllLocation?
If you want to use these method, you can call them with their corresponding parameter, like:
public IEnumerable<Location> GetAllLocation()
{
SqlParameter[] parameters =
{
new SqlParameter("parm1", SqlDbType.VarChar)
};
bool bool1 = RecordNavigation("string", parameters, SrcType.SqlQuery);
DataSet ds1 =DataRecords("string", SrcType.SqlQuery);
List<Location> lstLocation = new List<Location>();
//.....
return lstLocation;
}
Edit: If you mean call these two methods from models while the GetAllLocation() method is in controller, then add static to these two methods
and then call them like:
model:
public static DataSet DataRecords(string SrcSql, SrcType SourceType = SrcType.SqlQuery)
{
DataSet ds = new DataSet();
//...
return ds;
}
controller:
DataSet ds1 = ModelName.DataRecords("string", SrcType.SqlQuery);
Best Regards,
Jerry Cai