public Telephone viewtbill(Customer customer) { conString = ConfigurationManager.ConnectionStrings["paymatecontext"].ConnectionString; SqlConnection con = new SqlConnection(conString); SqlCommand cmd = new SqlCommand("select * from phonebill where dcusid='" + customer.CusId + "'", con); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); Telephone telephone = new Telephone(); if (rdr.Read()) { telephone.tnumber = Convert.ToInt64(rdr[2]); telephone.billamount = Convert.ToInt64(rdr[3]); } con.Close(); return(telephone); }
public Telephone pbill(Customer customer) { Telephone telephone = new Telephone(); return(telephone.viewtbill(customer)); }