コード例 #1
0
        public static int GetCurrentIdentity()
        {
            string sqlSelect = @"SELECT IDENT_CURRENT('ASSIGNMENT')  as currIdent";
            object ob        = SqlResult.ExecuteScalar(sqlSelect);

            return(Convert.ToInt32(ob));
        }
コード例 #2
0
        public static int GetPrescriptionInsertedID()
        {
            string sqlSelect = @"SELECT IDENT_CURRENT('PRESCRIPTION')  as currIdent";
            object ob        = SqlResult.ExecuteScalar(sqlSelect);

            return(Convert.ToInt32(ob));
        }
コード例 #3
0
        // 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);
        }
コード例 #4
0
        // 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)));
        }
コード例 #5
0
        public static int GetCurrentECID()
        {
            string sqlSelect = @"SELECT IDENT_CURRENT('EXAMINATIONCERTIFICATE') as CURRENTIDENTITY";

            return(Convert.ToInt32(SqlResult.ExecuteScalar(sqlSelect)));
        }