Ejemplo n.º 1
0
        public override int REQUISICION_INSERT(REQUISICION_BE z)
        {
            DbCommand Command     = null;
            int       returnValue = 0;

            try
            {
                Database DB = DatabaseFactory.CreateDatabase();
                using (TransactionScope MyTranasaccion = new TransactionScope())
                {
                    Command = DB.GetStoredProcCommand(Constants.CSP_REQUISICION);

                    DB.AddInParameter(Command, "@ID", DbType.String, string.Empty);
                    DB.AddInParameter(Command, "@FECHA", DbType.Date, z.FECHA);
                    DB.AddInParameter(Command, "@USUARIO", DbType.Int32, z.USUARIO);
                    DB.AddInParameter(Command, "@ACCION", DbType.Int32, Constants.AccionesTabla.ADD);

                    returnValue = DB.ExecuteNonQuery(Command);

                    MyTranasaccion.Complete();
                    return(1);
                }
            }
            catch (Exception ex)
            {
                string strError = ex.Message.ToString();
                return(0);
            }
            finally
            {
                Command.Dispose();
            }
        }
Ejemplo n.º 2
0
        public List <REQUISICION_BE> REQUISICION_GET(IDataReader reader)
        {
            List <REQUISICION_BE> zeban_p = new List <REQUISICION_BE>();

            try
            {
                while (reader.Read())
                {
                    REQUISICION_BE z = new REQUISICION_BE();

                    z.ID      = Int32.Parse(reader["ID"].ToString());
                    z.FECHA   = DateTime.Parse(reader["FECHA_CREA"].ToString());
                    z.USUARIO = Int32.Parse(reader["USUARIO"].ToString());

                    zeban_p.Add(z);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                reader.Close();
            }
            return(zeban_p);
        }
Ejemplo n.º 3
0
 public static int INSERT(REQUISICION_BE V)
 {
     return(AbstractDataAccesLayerHelper.GetDataAccessLayer().REQUISICION_INSERT(V));
 }
Ejemplo n.º 4
0
 public abstract int REQUISICION_INSERT(REQUISICION_BE V);