예제 #1
0
 private void CargarTitularLocal2(titular t)
 {
     cbo_seccional.SelectedValue = t.seccional.ToString();
     txt_cuilempresas.Text       = t.cuit.ToString();
     txt_cuiltitu.Text           = t.cuil_titu.ToString();
 }
예제 #2
0
        private void CargarTitularLocal(long cuil, long cuil_paciente)
        {
            DAL.HospitalDataSetTableAdapters.H2_Padron_Gente_Local_LaboTableAdapter adapter = new DAL.HospitalDataSetTableAdapters.H2_Padron_Gente_Local_LaboTableAdapter();
            DAL.HospitalDataSet.H2_Padron_Gente_Local_LaboDataTable aTable = adapter.GetData(cuil);
            titular t = new titular();

            if (aTable.Rows.Count > 0)
            {
                if (!aTable[0].IsCodOSNull())
                {
                    t.cod_os = Convert.ToInt32(aTable[0].CodOS);
                }
                if (!aTable[0].IscuitNull())
                {
                    t.cuit = Convert.ToInt64(aTable[0].cuit);
                }
                if (!aTable[0].IsSeccionalNull())
                {
                    t.seccional = Convert.ToInt32(aTable[0].Seccional);
                }
                t.cuil_titu = Convert.ToInt64(aTable[0].cuil_titu);
                if (!aTable[0].IsFecha_AltaNull())
                {
                    t.fechaalta = aTable[0].Fecha_Alta.ToShortDateString();
                }
                if (!aTable[0].IsFecha_ActualizacionNull())
                {
                    t.fechaactualizacion = aTable[0].Fecha_Actualizacion.ToShortDateString();
                }
                if (!aTable[0].IsFecha_BajaNull())
                {
                    t.fechabaja = aTable[0].Fecha_Baja.ToShortDateString();
                }
                t.documento = Convert.ToInt32(aTable[0].documento);
                t.apellido  = aTable[0].apellido;
                if (!aTable[0].IsRazon_SocialNull())
                {
                    t.RazonSocial = aTable[0].Razon_Social;
                }
            }
            else
            {
                if (cuil_paciente != 0)
                {
                    adapter = new DAL.HospitalDataSetTableAdapters.H2_Padron_Gente_Local_LaboTableAdapter();
                    aTable  = adapter.GetData(cuil_paciente);
                    t       = new titular();
                    if (aTable.Rows.Count > 0)
                    {
                        if (!aTable[0].IsCodOSNull())
                        {
                            t.cod_os = Convert.ToInt32(aTable[0].CodOS);
                        }
                        if (!aTable[0].IscuitNull())
                        {
                            t.cuit = Convert.ToInt64(aTable[0].cuit);
                        }
                        if (!aTable[0].IsSeccionalNull())
                        {
                            t.seccional = Convert.ToInt32(aTable[0].Seccional);
                        }
                        t.cuil_titu = Convert.ToInt64(aTable[0].cuil_titu);
                        if (!aTable[0].IsFecha_AltaNull())
                        {
                            t.fechaalta = aTable[0].Fecha_Alta.ToShortDateString();
                        }
                        if (!aTable[0].IsFecha_ActualizacionNull())
                        {
                            t.fechaactualizacion = aTable[0].Fecha_Actualizacion.ToShortDateString();
                        }
                        if (!aTable[0].IsFecha_BajaNull())
                        {
                            t.fechabaja = aTable[0].Fecha_Baja.ToShortDateString();
                        }
                        t.documento = Convert.ToInt32(aTable[0].documento);
                        t.apellido  = aTable[0].apellido;
                        if (!aTable[0].IsRazon_SocialNull())
                        {
                            t.RazonSocial = aTable[0].Razon_Social;
                        }
                    }
                }
            }

            CargarTitularLocal2(t);
        }