public static string gtSerives(int rid) { System.Data.DataTable dt = Mydb.ExecuteReadertoDataTable("select SERVICE_NAME from PRODUCT_SERVICE where SERVICE_ID in (select P_SERVICE_ID from REQUEST_SERVICE where REQUEST_ID=@rid)", new SqlParameter[] { new SqlParameter("@rid", rid) }, CommandType.Text); List <ProductService_> prss = new List <ProductService_>(); foreach (DataRow item in dt.Rows) { ProductService_ prs = new ProductService_(); prs.SERVICE_NAME = item["SERVICE_NAME"].ToString(); prss.Add(prs); } JavaScriptSerializer js = new JavaScriptSerializer(); return(js.Serialize(prss)); }
public static string getSelectedServT(int R) { DataTable dt = Mydb.ExecuteReadertoDataTable("select * from PRODUCT_SERVICE where SERVICE_ID in (select P_SERVICE_ID from REQUEST_SERVICE where REQUEST_ID=@R)", new SqlParameter[] { new SqlParameter("@R", R) }, CommandType.Text); List <ProductService_> pss = new List <ProductService_>(); foreach (DataRow item in dt.Rows) { ProductService_ ps = new ProductService_(); ps.SERVICE_ID = Convert.ToInt32(item["SERVICE_ID"]); ps.SERVICE_NAME = item["SERVICE_NAME"].ToString(); ps.COST = item["COST"].ToString(); ps.QUANTITY_IS = Convert.ToBoolean(item["QUANTITY_IS"]); pss.Add(ps); } JavaScriptSerializer js = new JavaScriptSerializer(); return(js.Serialize(pss)); }