public List <ProcureVM> GetPODetails(int?id) { ReqList li = new ReqList(); DataSet ds = li.Show_poiteminreport(id); List <ProcureVM> procure = new List <ProcureVM>(); foreach (DataRow dr in ds.Tables[0].Rows) { procure.Add(new ProcureVM { ItemName = dr["ItemName"].ToString(), Quantity = Convert.ToInt32(dr["Quantity"]), Total = Convert.ToDecimal(dr["TotalPrice"]) }); } return(procure); }