Exemplo n.º 1
0
        //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        public void Borrar(ConsecutivosDocumentos ConsecutivosDocumentos, bool Tran = false)
        {
            object[] ObjParameter = new object[2];
            ObjParameter[0] = ConsecutivosDocumentos.Id;
            try
            {
                this.InicializarMensajeError();
                this.OpenSqlBD();

                SqlCommand cmd = new SqlCommand();
                cmd = this.ConfigurarComando(TieneTransaccion.Si, "sp_del_ConsecutivosDocumentos", ObjParameter);
                cmd.ExecuteNonQuery();

                if (Tran == false)
                {
                    Commit();
                }
            }
            catch (Exception ex)
            {
                this.CodigoError = -1;
                if (Tran == false)
                {
                    Rollback();
                }
                fn.XtraMsg(ex.Message, MessageBoxIcon.Error);
            }
            finally
            {
                if (Tran == false)
                {
                    CloseSqlBD();
                }
            }
        }
Exemplo n.º 2
0
        //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        public ConsecutivosDocumentos Detalles(int Empresa, string Documento)
        {
            DataTable dt = fn.ObtieneDatos("sp_sel_ConsecutivosDocumentos", Documento, Empresa);
            ConsecutivosDocumentos det = new ConsecutivosDocumentos();

            if (dt.Rows.Count > 0)
            {
                det.Id = (int)dt.Rows[0]["Id"];
                // det.Empresa = (int)dt.Rows[0]["Empresa"];
                det.Documento   = dt.Rows[0]["Documento"].ToString();
                det.Consecutivo = (int)dt.Rows[0]["Consecutivo"];
            }
            else
            {
                return(null);
            }
            return(det);
        }