Exemple #1
0
        public void CRE_Sucursal(SqlCommand comando, MOD_Sucursal obj)
        {
            try
            {
                string sp = "SP_CRE_Sucursal";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@SUC_ID_SURCURSAL", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@SUC_ID_CENTRO_ATENCION", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@SUC_NOMBRE", SqlDbType.VarChar));
                comando.Parameters.Add(new SqlParameter("@SUC_TELEFONO", SqlDbType.VarChar));
                comando.Parameters.Add(new SqlParameter("@SUC_DIRECION", SqlDbType.VarChar));

                comando.Parameters[0].Value = obj.SUC_id_sucursal;
                comando.Parameters[1].Value = obj.SUC_id_centro_atencion;
                comando.Parameters[2].Value = obj.SUC_nombre;
                comando.Parameters[3].Value = obj.SUC_telefono;
                comando.Parameters[4].Value = obj.SUC_direccion;

                comando.ExecuteNonQuery();
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Exemple #2
0
 public void CRE_Sucursal(MOD_Sucursal obj)
 {
     try
     {
         this.IniciarTransaccion();
         AD_Sucursal objSucursal = new AD_Sucursal();
         objSucursal.CRE_Sucursal(this.comando, obj);
         this.ConfirmarTransaccion();
     }
     catch (Exception exc)
     {
         this.DeshacerTransaccion();
         throw exc;
     }
 }
Exemple #3
0
        public List<MOD_Sucursal> SEL_DL_Sucursal(SqlCommand comando, int centro_atencion)
        {
            try
            {
                string sp = "SP_SEL_DL_Sucursal";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@SUC_ID_CENTRO_ATENCION", SqlDbType.Int));

                comando.Parameters[0].Value = centro_atencion;

                IDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                List<MOD_Sucursal> lista = new List<MOD_Sucursal>();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MOD_Sucursal obj = new MOD_Sucursal();
                    obj.SUC_id_sucursal = Convert.ToInt32(dt.Rows[i]["SUC_ID_Surcursal"]);
                    obj.SUC_nombre = dt.Rows[i]["SUC_NOMBRE"].ToString();
                    lista.Add(obj);
                }

                return lista;

            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Exemple #4
0
        public MOD_Sucursal SEL_Grid_By_Id_Sucursal(SqlCommand comando, int codigo, int Centro_Atencion)
        {
            try
            {
                string sp = "SP_SEL_GRID_BY_ID_Sucursal";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@SUC_ID_SURCURSAL", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@SUC_ID_CENTRO_ATENCION", SqlDbType.Int));

                comando.Parameters[0].Value = codigo;
                comando.Parameters[1].Value = Centro_Atencion;

                IDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                MOD_Sucursal obj = new MOD_Sucursal();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj.SUC_id_sucursal = Convert.ToInt32(dt.Rows[i]["SUC_ID_SURCURSAL"]);
                    obj.SUC_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["SUC_ID_CENTRO_ATENCION"]);
                    obj.CEA_nombre = dt.Rows[i]["CEA_NOMBRE"].ToString();
                    obj.SUC_nombre = dt.Rows[i]["SUC_NOMBRE"].ToString();
                    obj.SUC_telefono = dt.Rows[i]["SUC_TELEFONO"].ToString();
                    obj.SUC_direccion = dt.Rows[i]["SUC_DIRECCION"].ToString();

                }

                return obj;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
        public Boolean CRE_Sucursal(MOD_Sucursal obj)
        {
            try
            {
                LOG_Sucursal Logica = new LOG_Sucursal();
                Logica.CRE_Sucursal(obj);
                return true;
            }
            catch (Exception )
            {
                return false;
                throw ;

            }
        }
 public void UPD_Sucursal(MOD_Sucursal obj)
 {
     try
     {
         LOG_Sucursal Logica = new LOG_Sucursal();
         Logica.UPD_Sucursal(obj);
     }
     catch (Exception )
     {
         throw ;
     }
 }