Exemplo n.º 1
0
        private get_response_supplier _getSupplier_ext(long m_id)
        {
            var mx = db.MARKETER_ext.Where(a => a.rel_MARKETER_id == m_id);

            get_response_supplier resp = new get_response_supplier();

            foreach (var n in mx)
            {
                switch (n.attr_name)
                {
                case "fax_number": resp.fax_number = n.value; break;

                case "process_external_transfer": resp.process_external_transfer = n.value; break;

                case "marketer_partner": resp.marketer_partner = n.value; break;

                case "intake_entity": resp.intake_entity = n.value; break;

                case "technology_platform": resp.technology_platform = n.value; break;

                case "pharmacy_customer_number": resp.pharmacy_customer_number = n.value; break;

                case "pharmacy_relationship": resp.pharmacy_relationship = n.value; break;

                case "pharmacy_fax": resp.pharmacy_fax = n.value; break;

                case "ptan_nuber": resp.ptan_number = n.value; break;
                }
            }

            return(resp);
        }
Exemplo n.º 2
0
        public IHttpActionResult GetSupplier([FromUri] get_supplier supplier)
        {
            var m = db.SUPPLIERs.Find(supplier.id);
            List <get_response_supplier> resp = new List <get_response_supplier>();

            if (m != null)
            {
                var ref_zip = db.ref_zip.Find(m.addr_zip_id);
                get_response_supplier      ext  = _getSupplier_ext(m.id);
                List <zip_search_address2> addr = new List <zip_search_address2>();
                if (ref_zip != null)
                {
                    addr.Add(new zip_search_address2
                    {
                        address1   = m.addr_address1,
                        address2   = m.addr_address2 == null ? "" : m.addr_address2,
                        city       = ref_zip == null ? "" : ref_zip.city_name,
                        state      = ref_zip == null ? "" : ref_zip.city_state,
                        state_long = ref_zip == null ? "" : ref_zip.city_state_long,
                        zip        = ref_zip == null ? "" : ref_zip.zip
                    });
                }


                resp.Add(new get_response_supplier
                {
                    legal_entity_name    = m.legal_entity_name,
                    healthsplash_contact = m.healthsplash_contact,
                    address = addr == null ? new List <zip_search_address2>()
                    {
                    } : addr,

                    federal_tax_number           = m.federal_tax_number,
                    primary_phone                = m.primary_phone,
                    organization_npi             = m.organization_npi,
                    patient_deductible_threshold = m.patient_deductible_threshold,
                    products_hcpcs               = m.products_hcpcs,

                    telemedicine_partner        = m.telemedicine_partner,
                    insurance_providers         = m.insurance_provider,
                    fax_number                  = ext.fax_number == null ? "" : ext.fax_number,
                    process_external_transfer   = ext.process_external_transfer == null ? "" : ext.process_external_transfer,
                    intake_entity               = ext.intake_entity == null ? "" : ext.intake_entity,
                    pharmacy_relationship       = ext.pharmacy_relationship == null ? "" : ext.pharmacy_relationship,
                    technology_platform         = ext.technology_platform == null ? "" : ext.technology_platform,
                    pharmacy_customer_number    = ext.pharmacy_customer_number == null ? "" : ext.pharmacy_customer_number,
                    pharmacy_fax                = ext.pharmacy_fax == null ? "" : ext.pharmacy_fax,
                    preferred_geographic_market = ext.preferred_geographic_market == null ? "" : ext.preferred_geographic_market,
                    marketer_partner            = ext.marketer_partner == null?"": ext.marketer_partner,
                    ptan_number                 = ext.ptan_number == null ? "" : ext.ptan_number,


                    primary_contact_name_first = m.prim_contact_name_first,
                    primary_contact_name_last  = m.prim_contact_name_last,
                    primary_contacty_phone     = m.prim_contact_phone,
                    primary_contact_email      = m.prim_contact_email,


                    operational_name_first = m.oper_contact_name_first,
                    operational_name_last  = m.oper_contact_name_last,
                    operational_phone      = m.oper_contact_phone,
                    operational_email      = m.oper_contact_email,

                    financial_name_first = m.fina_contact_name_first,
                    financial_name_last  = m.fina_contact_name_last,
                    financial_phone      = m.fina_contact_phone,
                    financial_email      = m.fina_contact_email,

                    authorize_signatory_name_first = m.auth_contact_name_first,
                    authorize_signatory_name_last  = m.auth_contact_name_last,
                    authorize_signatory_phone      = m.auth_contact_phone,
                    authorize_signatory_email      = m.auth_contact_email,
                });



                var ret1  = JsonConvert.SerializeObject(resp);
                var json1 = Newtonsoft.Json.Linq.JArray.Parse(ret1);

                string msg = resp.Count() + " Record found.";
                return(Json(new { data = json1, message = msg, success = true }));
            }


            return(Json(new { data = new string[] { }, message = "", success = false }));
        }