public void DeletePayment(per_procedure_payment_DAO o_dao) { conn = new SqlConnection(strConn); try { conn.Open(); comm = new SqlCommand("sp_delete_per_procedure_payment", conn); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandType = CommandType.StoredProcedure; comm.Parameters.AddWithValue("@sz_case_id", o_dao.sz_case_id); comm.Parameters.AddWithValue("@sz_bill_no", o_dao.sz_bill_no); comm.Parameters.AddWithValue("@sz_company_id", o_dao.sz_company_id); comm.Parameters.AddWithValue("@sz_payment_id", o_dao.sz_payment_id); comm.ExecuteNonQuery(); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); } finally { conn.Close(); } }
public void InsertPerProcedurePayment(ArrayList arrlist) { conn = new SqlConnection(strConn); try { conn.Open(); string Id = ""; for (int i = 0; i < arrlist.Count; i++) { per_procedure_payment_DAO o_dao = new per_procedure_payment_DAO(); o_dao = (per_procedure_payment_DAO)arrlist[i]; if (o_dao.sz_bill_no != null) { comm = new SqlCommand("sp_save_per_procedure_payment", conn); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandType = CommandType.StoredProcedure; comm.Parameters.AddWithValue("@sz_case_id", o_dao.sz_case_id); comm.Parameters.AddWithValue("@sz_bill_no", o_dao.sz_bill_no); comm.Parameters.AddWithValue("@sz_company_id", o_dao.sz_company_id); comm.Parameters.AddWithValue("@sz_proc_code", o_dao.sz_proc_code); comm.Parameters.AddWithValue("@date_of_service", o_dao.date_of_service); comm.Parameters.AddWithValue("@eligible_amount", o_dao.eligible_amount); comm.Parameters.AddWithValue("@amount_allowed", o_dao.amount_allowed); comm.Parameters.AddWithValue("@SZ_PROCEDURE_ID", o_dao.SZ_PROCEDURE_ID); comm.Parameters.AddWithValue("@SZ_BILL_TXN_DETAIL_ID", o_dao.SZ_BILL_TXN_DETAIL_ID); comm.Parameters.AddWithValue("@sz_user_id", o_dao.sz_user_id); comm.Parameters.AddWithValue("@check_date", o_dao.dt_check_date); comm.Parameters.AddWithValue("@check_number", o_dao.sz_check_number); comm.Parameters.AddWithValue("@c_paid_by", o_dao.i_paid_by); comm.Parameters.AddWithValue("@c_settlement_type", o_dao.i_settle); comm.Parameters.AddWithValue("@m_copay_deductable", o_dao.sz_copay); comm.Parameters.AddWithValue("@sz_notes", o_dao.sz_notes); SqlDataReader dr = comm.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { Id = dr[0].ToString(); } } dr.Close(); } else { comm = new SqlCommand("sp_save_Denial_Reason_per_proc_payment", conn); comm.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeOut"].ToString()); comm.CommandType = CommandType.StoredProcedure; comm.Parameters.AddWithValue("@i_per_procedure_payment_id", Id); comm.Parameters.AddWithValue("@i_denial_reason_id", o_dao.i_denial_reason_id); comm.Parameters.AddWithValue("@sz_company_id", o_dao.sz_company_id); comm.Parameters.AddWithValue("@sz_user_id", o_dao.sz_user_id); comm.ExecuteNonQuery(); } } } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); } finally { conn.Close(); } }