Beispiel #1
0
        public List <SqlParameter> SetParametersAddHeaderDevolucion(ClassDevolucion documento)
        {
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter()
                {
                    ParameterName = "@p1", SqlDbType = SqlDbType.NVarChar, Value = documento.Numero
                },
                new SqlParameter()
                {
                    ParameterName = "@p2", SqlDbType = SqlDbType.DateTime, Value = documento.Fecha
                },
                new SqlParameter()
                {
                    ParameterName = "@p3", SqlDbType = SqlDbType.NVarChar, Value = documento.Id_Cust
                },
                new SqlParameter()
                {
                    ParameterName = "@p4", SqlDbType = SqlDbType.NVarChar, Value = documento.Razon
                },
                new SqlParameter()
                {
                    ParameterName = "@p5", SqlDbType = SqlDbType.NVarChar, Value = documento.DocAnulado
                }
            };

            return(sp);
        }
Beispiel #2
0
        public void Add(ClassDevolucion documento, Boolean ismessage)
        {
            //ADD HEADER TABLE DEVOLUCION.
            CommandSqlGeneric(R.SQL.DATABASE.NAME,
                              R.SQL.QUERY_SQL.DEVOLUCION.SQL_INSERT_HEADER, SetParametersAddHeaderDevolucion(documento),
                              ismessage, R.ERROR_MESSAGES.DEVOLUCIONES.MESSAGE_ERROR_INSERT_HEADER);

            //ADD ITEMROWS TABLE.
            foreach (Item_Devol item in documento.items)
            {
                CommandSqlGeneric(R.SQL.DATABASE.NAME, R.SQL.QUERY_SQL.DEVOLUCION.SQL_INSERT_ITEMROWS,
                                  SetParametersItemRowsDevolucion(item, documento.Numero), ismessage,
                                  R.ERROR_MESSAGES.DEVOLUCIONES.MESSAGE_ERROR_INSERT_ITEMROWS);
            }
        }