public bool IsPaidCustomer(long customerNum) { int count = 0; string connectStr = ConfigurationManager.ConnectionStrings["DBRegKey"].ConnectionString; //This query is seeing if any family member of the patient with the registration key has a specific repeating charge string command = "SELECT COUNT(*) FROM repeatcharge,patient " + "WHERE repeatcharge.PatNum=patient.PatNum " + "AND patient.Guarantor=(SELECT patkey.Guarantor FROM patient patkey WHERE patkey.PatNum=" + POut.Long(customerNum) + ") " + "AND ProcCode='027' AND (DateStop='0001-01-01' OR DateStop > NOW())"; WebHostSynch.Db db = new WebHostSynch.Db(); db.setConn(connectStr); DataTable table = db.GetTable(command); if (table.Rows.Count != 0) { count = PIn.Int(table.Rows[0][0].ToString()); } if (count > 0) { return(true); } else { return(false); } }
public bool IsPaidCustomer(long customerNum) { int count=0; string connectStr=ConfigurationManager.ConnectionStrings["DBRegKey"].ConnectionString; //This query is seeing if any family member of the patient with the registration key has a specific repeating charge string command ="SELECT COUNT(*) FROM repeatcharge,patient " +"WHERE repeatcharge.PatNum=patient.PatNum " +"AND patient.Guarantor=(SELECT patkey.Guarantor FROM patient patkey WHERE patkey.PatNum="+POut.Long(customerNum)+") " +"AND ProcCode='027' AND (DateStop='0001-01-01' OR DateStop > NOW())"; WebHostSynch.Db db = new WebHostSynch.Db(); db.setConn(connectStr); DataTable table=db.GetTable(command); if(table.Rows.Count!=0) { count=PIn.Int(table.Rows[0][0].ToString()); } if(count>0) { return true; } else { return false; } }