Esempio n. 1
0
        public ArrayList Search(gbmodel.user.User p_oUser, SearchParameters p_oSearchParameter)
        {
            List <SqlParameter> oParams = new List <SqlParameter>();
            ArrayList           oResult = null;

            oParams.Add(new SqlParameter("@sz_company_id", p_oUser.Account.ID));
            oParams.Add(new SqlParameter("@i_start_index", p_oSearchParameter.StartIndex));
            oParams.Add(new SqlParameter("@i_end_index", p_oSearchParameter.EndIndex));
            oParams.Add(new SqlParameter("@sz_order_by", p_oSearchParameter.OrderBy));
            oParams.Add(new SqlParameter("@sz_search_text", p_oSearchParameter.SearchText));

            DataSet ds = null;

            try
            {
                ds = DBUtil.DataSet(Procedures.PR_SEARCH_PATIENT, oParams);
            }
            catch (Exception io)
            {
            }

            oResult = new ArrayList(2);
            List <gbmodel.patient.Patient> oPatientList = new List <gbmodel.patient.Patient>();

            gbmodel.patient.Patient oPatient = null;
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                oPatient             = new gbmodel.patient.Patient();
                oPatient.RowID       = Convert.ToInt32(ds.Tables[0].Rows[i]["rowid"].ToString());
                oPatient.CaseID      = Convert.ToInt32(ds.Tables[0].Rows[i]["sz_case_id"].ToString());
                oPatient.CaseNo      = Convert.ToInt32(ds.Tables[0].Rows[i]["sz_case_no"].ToString());
                oPatient.ClaimNumber = ds.Tables[0].Rows[i]["sz_claim_number"].ToString();
                oPatient.Name        = ds.Tables[0].Rows[i]["sz_patient_name"].ToString();

                gbmodel.carrier.Carrier oCarrier = new gbmodel.carrier.Carrier();
                oCarrier.Name = ds.Tables[0].Rows[i]["sz_insurance_company"].ToString();

                oPatient.Carrier = oCarrier;
                oPatient.ID      = ds.Tables[0].Rows[i]["sz_patient_id"].ToString();
                oPatient.DOA     = ds.Tables[0].Rows[i]["dt_accident_date"].ToString();

                gbmodel.account.Account oAccount = new gbmodel.account.Account();
                oAccount.ID = ds.Tables[0].Rows[i]["sz_company_id"].ToString();

                oPatient.Account   = oAccount;
                oPatient.FirstName = ds.Tables[0].Rows[i]["sz_patient_first_name"].ToString();
                oPatient.LastName  = ds.Tables[0].Rows[i]["sz_patient_last_name"].ToString();

                oPatientList.Add(oPatient);
            }

            oResult.Add(oPatientList.ToArray());

            for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
            {
                oResult.Add(ds.Tables[1].Rows[i]["count"].ToString());
            }
            return(oResult);
        }
Esempio n. 2
0
        public List <gbmodel.carrier.Carrier> Select(gbmodel.user.User oUser, gbmodel.carrier.Carrier oCarrier)
        {
            SqlConnection sqlConnection          = null;
            List <gbmodel.carrier.Carrier> oList = new List <gbmodel.carrier.Carrier>();

            try
            {
                sqlConnection = new SqlConnection(DBUtil.ConnectionString);
                sqlConnection.Open();
                SqlCommand sqlCommand = null;
                sqlCommand             = new SqlCommand(Procedures.PR_CARRIER_SELECT, sqlConnection);//TODO Add procedure name
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.Parameters.Add(new SqlParameter("@id", oUser.Account.ID));
                sqlCommand.Parameters.Add(new SqlParameter("@FLAG", "INSURANCE_LIST"));
                SqlDataAdapter da = new SqlDataAdapter(sqlCommand);
                DataSet        ds = new DataSet();
                da.Fill(ds);
                if (ds != null)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        DataRow dr = ds.Tables[0].Rows[i];
                        gbmodel.carrier.Carrier oElement = new gbmodel.carrier.Carrier();
                        oElement.Name = dr["DESCRIPTION"].ToString(); //to do
                        oElement.Id   = dr["CODE"].ToString();        //TODO

                        oList.Add(oElement);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                if (sqlConnection.State == ConnectionState.Open)
                {
                    sqlConnection.Close();
                }
            }
            return(oList);
        }