Exemple #1
0
        /// <summary>
        /// modify a record
        /// </summary>
        public void modifyz_despacho_inhabil(z_despacho_inhabil myz_despacho_inhabil)
        {
            CnxBase myBase = new CnxBase();
            string  reqSQL = "UPDATE z_despacho_inhabil SET id_despacho=" + myz_despacho_inhabil.id_despacho + ",id_area=" + myz_despacho_inhabil.id_area + ",codigo_llamado=" + myz_despacho_inhabil.codigo_llamado + ",despacho_b=" + myz_despacho_inhabil.despacho_b + ",despacho_bx=" + myz_despacho_inhabil.despacho_bx + ",despacho_br=" + myz_despacho_inhabil.despacho_br + ",despacho_q=" + myz_despacho_inhabil.despacho_q + ",despacho_qr=" + myz_despacho_inhabil.despacho_qr + ",despacho_m=" + myz_despacho_inhabil.despacho_m + ",despacho_r=" + myz_despacho_inhabil.despacho_r + ",despacho_rx=" + myz_despacho_inhabil.despacho_rx + ",despacho_h=" + myz_despacho_inhabil.despacho_h + ",despacho_z=" + myz_despacho_inhabil.despacho_z + ",despacho_x=" + myz_despacho_inhabil.despacho_x + ",despacho_lt=" + myz_despacho_inhabil.despacho_lt + ",despacho_s=" + myz_despacho_inhabil.despacho_s + ",despacho_k=" + myz_despacho_inhabil.despacho_k + ",despacho_j=" + myz_despacho_inhabil.despacho_j + ",dos_6=" + myz_despacho_inhabil.dos_6 + " WHERE (id_despacho=" + myz_despacho_inhabil.id_despacho + ")";

            try
            {
                NpgsqlConnection myConn    = myBase.OpenConnection(myBase.cnxString);
                NpgsqlCommand    myCommand = new NpgsqlCommand(reqSQL, myConn);
                myCommand.ExecuteNonQuery();
                myBase.CloseConnection(myConn);
            }
            catch (Exception myErr)
            {
                throw (new Exception(myErr.ToString() + reqSQL));
            }
        }
Exemple #2
0
        /// <summary>
        /// add a record
        /// </summary>
        /// <param name="myID"></param>
        public void addz_despacho_inhabil(z_despacho_inhabil myz_despacho_inhabil)
        {
            CnxBase myBase = new CnxBase();
            string  reqSQL = "INSERT INTO z_despacho_inhabil (id_despacho,id_area,codigo_llamado,despacho_b,despacho_bx,despacho_br,despacho_q,despacho_qr,despacho_m,despacho_r,despacho_rx,despacho_h,despacho_z,despacho_x,despacho_lt,despacho_s,despacho_k,despacho_j,dos_6) VALUES (" + myz_despacho_inhabil.id_despacho + "," + myz_despacho_inhabil.id_area + "," + myz_despacho_inhabil.codigo_llamado + "," + myz_despacho_inhabil.despacho_b + "," + myz_despacho_inhabil.despacho_bx + "," + myz_despacho_inhabil.despacho_br + "," + myz_despacho_inhabil.despacho_q + "," + myz_despacho_inhabil.despacho_qr + "," + myz_despacho_inhabil.despacho_m + "," + myz_despacho_inhabil.despacho_r + "," + myz_despacho_inhabil.despacho_rx + "," + myz_despacho_inhabil.despacho_h + "," + myz_despacho_inhabil.despacho_z + "," + myz_despacho_inhabil.despacho_x + "," + myz_despacho_inhabil.despacho_lt + "," + myz_despacho_inhabil.despacho_s + "," + myz_despacho_inhabil.despacho_k + "," + myz_despacho_inhabil.despacho_j + "," + myz_despacho_inhabil.dos_6 + ")";

            try
            {
                NpgsqlConnection myConn    = myBase.OpenConnection(myBase.cnxString);
                NpgsqlCommand    myCommand = new NpgsqlCommand(reqSQL, myConn);
                myCommand.ExecuteNonQuery();
                myBase.CloseConnection(myConn);
            }
            catch (Exception myErr)
            {
                throw (new Exception(myErr.ToString() + reqSQL));
            }
        }
Exemple #3
0
        /// <summary>
        /// get an instance of object
        /// </summary>
        /// <param name="myID"></param>
        public z_despacho_inhabil getObjectz_despacho_inhabil(System.Int32 id_despacho)
        {
            z_despacho_inhabil myz_despacho_inhabil = new z_despacho_inhabil();
            CnxBase            myBase = new CnxBase();
            string             reqSQL = "SELECT id_despacho,id_area,codigo_llamado,despacho_b,despacho_bx,despacho_br,despacho_q,despacho_qr,despacho_m,despacho_r,despacho_rx,despacho_h,despacho_z,despacho_x,despacho_lt,despacho_s,despacho_k,despacho_j,despacho_mx,despacho_ut,dos_6 FROM z_despacho_inhabil WHERE (id_despacho=" + id_despacho + ")";

            try
            {
                NpgsqlConnection myConn    = myBase.OpenConnection(myBase.cnxString);
                NpgsqlCommand    myCommand = new NpgsqlCommand(reqSQL, myConn);
                NpgsqlDataReader myReader  = myCommand.ExecuteReader();
                if (myReader.Read())
                {
                    myz_despacho_inhabil.id_despacho    = Convert.ToInt32(myReader[0]);
                    myz_despacho_inhabil.id_area        = Convert.ToInt32(myReader[1]);
                    myz_despacho_inhabil.codigo_llamado = Convert.ToInt32(myReader[2]);
                    myz_despacho_inhabil.despacho_b     = Convert.ToInt32(myReader[3]);
                    myz_despacho_inhabil.despacho_bx    = Convert.ToInt32(myReader[4]);
                    myz_despacho_inhabil.despacho_br    = Convert.ToInt32(myReader[5]);
                    myz_despacho_inhabil.despacho_q     = Convert.ToInt32(myReader[6]);
                    myz_despacho_inhabil.despacho_qr    = Convert.ToInt32(myReader[7]);
                    myz_despacho_inhabil.despacho_m     = Convert.ToInt32(myReader[8]);
                    myz_despacho_inhabil.despacho_r     = Convert.ToInt32(myReader[9]);
                    myz_despacho_inhabil.despacho_rx    = Convert.ToInt32(myReader[10]);
                    myz_despacho_inhabil.despacho_h     = Convert.ToInt32(myReader[11]);
                    myz_despacho_inhabil.despacho_z     = Convert.ToInt32(myReader[12]);
                    myz_despacho_inhabil.despacho_x     = Convert.ToInt32(myReader[13]);
                    myz_despacho_inhabil.despacho_lt    = Convert.ToInt32(myReader[14]);
                    myz_despacho_inhabil.despacho_s     = Convert.ToInt32(myReader[15]);
                    myz_despacho_inhabil.despacho_k     = Convert.ToInt32(myReader[16]);
                    myz_despacho_inhabil.despacho_j     = Convert.ToInt32(myReader[17]);
                    myz_despacho_inhabil.despacho_mx    = Convert.ToInt32(myReader[18]);
                    myz_despacho_inhabil.despacho_ut    = Convert.ToInt32(myReader[19]);
                    myz_despacho_inhabil.dos_6          = Convert.ToBoolean(myReader[20]);
                }
                myBase.CloseConnection(myConn);
            }
            catch (Exception myErr)
            {
                throw (new Exception(myErr.ToString() + reqSQL));
            }
            return(myz_despacho_inhabil);
        }