public static int GetCurrentIdentity() { string sqlSelect = @"SELECT IDENT_CURRENT('ASSIGNMENT') as currIdent"; object ob = SqlResult.ExecuteScalar(sqlSelect); return(Convert.ToInt32(ob)); }
public static int GetPrescriptionInsertedID() { string sqlSelect = @"SELECT IDENT_CURRENT('PRESCRIPTION') as currIdent"; object ob = SqlResult.ExecuteScalar(sqlSelect); return(Convert.ToInt32(ob)); }
// Get total price patient has not pay yet public static decimal GetPatientPriceNeedPay(int patientID) { decimal totalPrice = new decimal(); DataTable patientBillTable = new DataTable(); string sqlSelect = @"SELECT Sum(TOTALPRICE) FROM BILL WHERE (PATIENTID=@PATIENTID) AND STATE = 0"; SqlParameter[] sqlParameters = { new SqlParameter("@PATIENTID", patientID) }; decimal.TryParse(SqlResult.ExecuteScalar(sqlSelect, sqlParameters).ToString(), out totalPrice); return(totalPrice); }
// Get current identity bill ID in database public static int GetCurrentBillID() { string sqlSelect = @"SELECT IDENT_CURRENT('BILL') as CURRENTIDENTITY"; return(Convert.ToInt32(SqlResult.ExecuteScalar(sqlSelect))); }
public static int GetCurrentECID() { string sqlSelect = @"SELECT IDENT_CURRENT('EXAMINATIONCERTIFICATE') as CURRENTIDENTITY"; return(Convert.ToInt32(SqlResult.ExecuteScalar(sqlSelect))); }