예제 #1
0
        private void Cargasocio(int opcion)
        {
            SocioBE SocioBE = new SocioBE()
            {
                OPCION      = opcion,
                USUARIO     = General.General.GetCodigoUsuario,
                RazonSocial = txtRazonSocial.Text.Trim(),
                CodSocio    = CodSocio
            };

            dsSocio = SocioBL.ProcesarSocio(SocioBE);
            dgvSocios.DataSource = dsSocio.Tables[0];
        }
 private void CargarCorreos()
 {
     try
     {
         SocioBE oEntity = new SocioBE()
         {
             OPCION   = 4,
             USUARIO  = General.General.GetUsuario,
             CodSocio = Codigo
         };
         dgvCorreos.DataSource = new SocioBL().ProcesarSocio(oEntity).Tables[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #3
0
        public DataSet ProcesarSocio(SocioBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("Socio_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "CodSocio", DbType.String, BE.CodSocio);
                db.AddInParameter(cmd, "RazonSocial", DbType.String, BE.RazonSocial);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
예제 #4
0
 public DataSet ProcesarSocio(SocioBE BE)
 {
     return(SocioDA.ProcesarSocio(BE));
 }
예제 #5
0
        public static SocioBE Get(string usuario, string dominio)
        {
            SocioBE item = null;

            dominio = dominio.Replace("-", ".");
            try
            {
                var connectionString = CommonHelpers.GetCnn(CommonHelpers.cnnStringName_Amazon).ConnectionString;
                using (SqlConnection cnn = new SqlConnection(connectionString))
                    using (SqlCommand cmd = new SqlCommand("[dbo].[Users_g]", cnn))
                    {
                        cmd.CommandType = System.Data.CommandType.StoredProcedure;

                        cmd.Parameters.AddWithValue("@usr", usuario);

                        cmd.Parameters.AddWithValue("@domain", dominio);

                        cnn.Open();

                        using (SqlDataReader reader = cmd.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                item          = new SocioBE();
                                item.UserName = usuario;
                                item.Id       = (Guid)(reader["Id"]);

                                item.Apellido = (string)(reader["apellido"]);
                                item.Nombre   = (string)(reader["nombre"]);

                                if (reader["FechaNacimiento"] != DBNull.Value)
                                {
                                    item.FechaNacimiento = Convert.ToDateTime(reader["FechaNacimiento"]);
                                }

                                if (reader["Documento"] != DBNull.Value)
                                {
                                    item.Documento = reader["Documento"].ToString();
                                }
                                if (reader["Cuit"] != DBNull.Value)
                                {
                                    item.Cuit = reader["Cuit"].ToString();
                                }

                                if (reader["sexo"] != DBNull.Value)
                                {
                                    item.Sexo = reader["sexo"].ToString();
                                }
                                if (reader["nacionalidad"] != DBNull.Value)
                                {
                                    item.Nacionalidad = reader["nacionalidad"].ToString();
                                }

                                if (reader["telefono"] != DBNull.Value)
                                {
                                    item.Telefono = reader["telefono"].ToString();
                                }
                            }
                        }
                    }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(item);
        }